netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Mengyuan Lou <mengyuanlou@net-swift.com>
Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com
Subject: Re: [PATCH net-next] net: ngbe: Variables need to be initialized
Date: Mon, 10 Oct 2022 17:44:43 -0700	[thread overview]
Message-ID: <20221010174443.563b6cd8@kernel.org> (raw)
In-Reply-To: <20221009070912.55353-1-mengyuanlou@net-swift.com>

On Sun,  9 Oct 2022 15:09:12 +0800 Mengyuan Lou wrote:
> Variables need to be initialized in ngbe_shutdown()
> Fix: commit <e79e40c83b9f> ("net: ngbe: Add build support for ngbe")

Please look at the git history to find out what the correct form is for
the Fixes tag.

> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> ---
>  drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> index 7674cb6e5700..f754e53eb852 100644
> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> @@ -46,7 +46,7 @@ static void ngbe_dev_shutdown(struct pci_dev *pdev, bool *enable_wake)
>  
>  static void ngbe_shutdown(struct pci_dev *pdev)
>  {
> -	bool wake;
> +	bool wake = false;
>  
>  	ngbe_dev_shutdown(pdev, &wake);

The callee should make sure to always write to the variable, caller
init is a worse fix.

      reply	other threads:[~2022-10-11  0:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09  7:09 [PATCH net-next] net: ngbe: Variables need to be initialized Mengyuan Lou
2022-10-11  0:44 ` Jakub Kicinski [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=20221010174443.563b6cd8@kernel.org \
    --to=kuba@kernel.org \
    --cc=jiawenwu@trustnetic.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).