All of lore.kernel.org
 help / color / mirror / Atom feed
* re: octeontx2-af: cn10k: MAC internal loopback support
@ 2021-02-15 16:52 Colin Ian King
  2021-02-15 18:01 ` [EXT] " Geethasowjanya Akula
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2021-02-15 16:52 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
	hariprasad, Subbaraya Sundeep, netdev, linux-kernel

Hi,

Static analysis on linux-next today using Coverity found an issue in the
following commit:

commit 3ad3f8f93c81f81d6e28b2e286b03669cc1fb3b0
Author: Hariprasad Kelam <hkelam@marvell.com>
Date:   Thu Feb 11 21:28:34 2021 +0530

    octeontx2-af: cn10k: MAC internal loopback support

The analysis is as follows:

723 static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
724 {
725        struct mac_ops *mac_ops;

   1. var_decl: Declaring variable lmac_id without initializer.

726        u8 cgx_id, lmac_id;
727

   2. Condition !is_cgx_config_permitted(rvu, pcifunc), taking false branch.

728        if (!is_cgx_config_permitted(rvu, pcifunc))
729                return -EPERM;
730

    Uninitialized scalar variable (UNINIT)

731        mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
732

   Uninitialized scalar variable (UNINIT)
   3. uninit_use_in_call: Using uninitialized value lmac_id when calling
*mac_ops->mac_lmac_intl_lbk.

733        return mac_ops->mac_lmac_intl_lbk(rvu_cgx_pdata(cgx_id, rvu),
734                                          lmac_id, en);
735 }

Variables cgx_id and lmac_id are no longer being initialized and garbage
values are being passed into function calls.  Originally, these
variables were being initialized with a call to rvu_get_cgx_lmac_id()
but that has now been removed.

Colin

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

* Re: [EXT] re: octeontx2-af: cn10k: MAC internal loopback support
  2021-02-15 16:52 octeontx2-af: cn10k: MAC internal loopback support Colin Ian King
@ 2021-02-15 18:01 ` Geethasowjanya Akula
  0 siblings, 0 replies; 2+ messages in thread
From: Geethasowjanya Akula @ 2021-02-15 18:01 UTC (permalink / raw)
  To: Colin Ian King, Hariprasad Kelam
  Cc: Sunil Kovvuri Goutham, Linu Cherian, Jerin Jacob Kollanukkaran,
	Subbaraya Sundeep Bhatta, netdev, linux-kernel

Hi Colin,

I have submitted the patch fixing the reported issue to net-next branch.

Thank you,
Geetha.

________________________________________
From: Colin Ian King <colin.king@canonical.com>
Sent: Monday, February 15, 2021 10:22 PM
To: Hariprasad Kelam
Cc: Sunil Kovvuri Goutham; Linu Cherian; Geethasowjanya Akula; Jerin Jacob Kollanukkaran; Hariprasad Kelam; Subbaraya Sundeep Bhatta; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [EXT] re: octeontx2-af: cn10k: MAC internal loopback support

External Email

----------------------------------------------------------------------
Hi,

Static analysis on linux-next today using Coverity found an issue in the
following commit:

commit 3ad3f8f93c81f81d6e28b2e286b03669cc1fb3b0
Author: Hariprasad Kelam <hkelam@marvell.com>
Date:   Thu Feb 11 21:28:34 2021 +0530

    octeontx2-af: cn10k: MAC internal loopback support

The analysis is as follows:

723 static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
724 {
725        struct mac_ops *mac_ops;

   1. var_decl: Declaring variable lmac_id without initializer.

726        u8 cgx_id, lmac_id;
727

   2. Condition !is_cgx_config_permitted(rvu, pcifunc), taking false branch.

728        if (!is_cgx_config_permitted(rvu, pcifunc))
729                return -EPERM;
730

    Uninitialized scalar variable (UNINIT)

731        mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
732

   Uninitialized scalar variable (UNINIT)
   3. uninit_use_in_call: Using uninitialized value lmac_id when calling
*mac_ops->mac_lmac_intl_lbk.

733        return mac_ops->mac_lmac_intl_lbk(rvu_cgx_pdata(cgx_id, rvu),
734                                          lmac_id, en);
735 }

Variables cgx_id and lmac_id are no longer being initialized and garbage
values are being passed into function calls.  Originally, these
variables were being initialized with a call to rvu_get_cgx_lmac_id()
but that has now been removed.

Colin

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

end of thread, other threads:[~2021-02-15 18:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 16:52 octeontx2-af: cn10k: MAC internal loopback support Colin Ian King
2021-02-15 18:01 ` [EXT] " Geethasowjanya Akula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.