Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Neftin, Sasha" <sasha.neftin@intel.com>
To: Yu Hao <yhao016@ucr.edu>, <jesse.brandeburg@intel.com>,
	<anthony.l.nguyen@intel.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
	"Edri, Michael" <michael.edri@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH] ethernet: e1000e: Fix possible uninit bug
Date: Wed, 5 Jul 2023 18:47:26 +0300	[thread overview]
Message-ID: <9fff2b17-0b66-93a0-87aa-ca6479cb0663@intel.com> (raw)
In-Reply-To: <CA+UBctC57Lx=8Eh6P51cVz+cyb02GE_B-dWnYhffWoc-nm7v6Q@mail.gmail.com>

On 7/5/2023 03:10, Yu Hao wrote:
> The variable phy_data should be initialized in function e1e_rphy.
> However, there is not return value check, which means there is a
> possible uninit read later for the variable.
> 
> Signed-off-by: Yu Hao <yhao016@ucr.edu>
> ---
>   drivers/net/ethernet/intel/e1000e/netdev.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c
> b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 771a3c909c45..455af5e55cc6 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -6910,8 +6910,11 @@ static int __e1000_resume(struct pci_dev *pdev)
>      /* report the system wakeup cause from S3/S4 */
>      if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
>          u16 phy_data;
> +       s32 ret_val;

why just not initialize u16 phy_data = 0? How did it hurt us? (legacy)

> 
> -       e1e_rphy(&adapter->hw, BM_WUS, &phy_data);
> +       ret_val = e1e_rphy(&adapter->hw, BM_WUS, &phy_data);
> +       if (ret_val)
> +           return ret_val;
>          if (phy_data) {
>              e_info("PHY Wakeup cause - %s\n",
>                     phy_data & E1000_WUS_EX ? "Unicast Packet" :

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-07-05 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  0:10 [Intel-wired-lan] [PATCH] ethernet: e1000e: Fix possible uninit bug Yu Hao
2023-07-05 15:47 ` Neftin, Sasha [this message]
2023-07-10  0:55   ` Yu Hao
2023-07-10  7:55     ` Neftin, Sasha
2023-07-10  8:13 ` Denis Kirjanov
  -- strict thread matches above, loose matches on Subject: below --
2023-07-10  0:57 Yu Hao
2023-07-10  4:02 ` Pavan Chebbi

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=9fff2b17-0b66-93a0-87aa-ca6479cb0663@intel.com \
    --to=sasha.neftin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=dima.ruinskiy@intel.com \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.edri@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yhao016@ucr.edu \
    /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