linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] octeontx2-af: cn10k: Uninitialized variables
@ 2021-02-12 18:39 Gustavo A. R. Silva
  2021-02-14  3:33 ` [EXT] " Geethasowjanya Akula
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2021-02-12 18:39 UTC (permalink / raw)
  To: Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
	hariprasad, Subbaraya Sundeep, David S. Miller, Jakub Kicinski
  Cc: netdev, linux-kernel, Gustavo A. R. Silva

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [EXT] [bug report] octeontx2-af: cn10k: Uninitialized variables
  2021-02-12 18:39 [bug report] octeontx2-af: cn10k: Uninitialized variables Gustavo A. R. Silva
@ 2021-02-14  3:33 ` Geethasowjanya Akula
  0 siblings, 0 replies; 2+ messages in thread
From: Geethasowjanya Akula @ 2021-02-14  3:33 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Sunil Kovvuri Goutham, Linu Cherian,
	Jerin Jacob Kollanukkaran, Hariprasad Kelam,
	Subbaraya Sundeep Bhatta, David S. Miller, Jakub Kicinski
  Cc: netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-14  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 18:39 [bug report] octeontx2-af: cn10k: Uninitialized variables Gustavo A. R. Silva
2021-02-14  3:33 ` [EXT] " Geethasowjanya Akula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).