From: Geethasowjanya Akula <gakula@marvell.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>,
Hariprasad Kelam <hkelam@marvell.com>,
Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXT] [bug report] octeontx2-af: cn10k: Uninitialized variables
Date: Sun, 14 Feb 2021 03:33:24 +0000 [thread overview]
Message-ID: <DM6PR18MB260244467263DDD91ECF0D9FCD899@DM6PR18MB2602.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20210212183917.GA279621@embeddedor>
Hi Gustavo,
please see inline.
Thank you,
Geetha.
________________________________________
>From: Gustavo A. R. Silva <gustavoars@kernel.org>
>Sent: Saturday, February 13, 2021 12:09 AM
>To: Sunil Kovvuri Goutham; Linu Cherian; Geethasowjanya Akula; Jerin Jacob >Kollanukkaran; Hariprasad Kelam; Subbaraya Sundeep Bhatta; David S. Miller; Jakub >Kicinski
>Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Gustavo A. R. Silva
>Subject: [EXT] [bug report] octeontx2-af: cn10k: Uninitialized variables
>External Email
----------------------------------------------------------------------
>Hi,
>Variables cgx_id and lmac_id are being used uninitialized at lines 731
>and 733 in the following function:
>723 static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
>724 {
>725 struct mac_ops *mac_ops;
>726 u8 cgx_id, lmac_id;
>727
>728 if (!is_cgx_config_permitted(rvu, pcifunc))
>729 return -EPERM;
>730
>731 mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
>732
>733 return mac_ops->mac_lmac_intl_lbk(rvu_cgx_pdata(cgx_id, rvu),
>734 lmac_id, en);
735 }
>This bug was introduced by commit 3ad3f8f93c81 ("octeontx2-af: cn10k: MAC internal >loopback support")
>What's the right solution for this?
Thanks Gustavo. Sorry I missed it. Below is the fix.
static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
{
+ int pf = rvu_get_pf(pcifunc);
struct mac_ops *mac_ops;
u8 cgx_id, lmac_id;
if (!is_cgx_config_permitted(rvu, pcifunc))
return -EPERM;
+ rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
Thanks
--
Gustavo
prev parent reply other threads:[~2021-02-14 3:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 18:39 Gustavo A. R. Silva
2021-02-14 3:33 ` Geethasowjanya Akula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR18MB260244467263DDD91ECF0D9FCD899@DM6PR18MB2602.namprd18.prod.outlook.com \
--to=gakula@marvell.com \
--cc=davem@davemloft.net \
--cc=gustavoars@kernel.org \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®