netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Chaoming Li <chaoming_li@realsil.com.cn>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Subject: Re: [1/1] rtlwifi: always initialize variables given to RT_TRACE()
Date: Thu, 14 Dec 2017 12:44:13 +0000 (UTC)	[thread overview]
Message-ID: <20171214124413.A4A5560A60@smtp.codeaurora.org> (raw)
In-Reply-To: <20171210195159.7454-1-nicolas.iooss_linux@m4x.org>

Nicolas Iooss <nicolas.iooss_linux@m4x.org> wrote:

> In rtl_rx_ampdu_apply(), when rtlpriv->cfg->ops->get_btc_status()
> returns false, RT_TRACE() is called with the values of variables
> reject_agg and agg_size, which have not been initialized.
> 
> Always initialize these variables in order to prevent using
> uninitialized values.
> 
> This issue has been found with clang. The compiler reported:
> 
>     drivers/net/wireless/realtek/rtlwifi/base.c:1665:6: error: variable
>     'agg_size' is used uninitialized whenever 'if' condition is false
>     [-Werror,-Wsometimes-uninitialized]
>             if (rtlpriv->cfg->ops->get_btc_status())
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/net/wireless/realtek/rtlwifi/base.c:1671:31: note:
>     uninitialized use occurs here
>                      reject_agg, ctrl_agg_size, agg_size);
>                                                 ^~~~~~~~
> 
>     drivers/net/wireless/realtek/rtlwifi/base.c:1665:6: error: variable
>     'reject_agg' is used uninitialized whenever 'if' condition
>           is false [-Werror,-Wsometimes-uninitialized]
>             if (rtlpriv->cfg->ops->get_btc_status())
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     drivers/net/wireless/realtek/rtlwifi/base.c:1671:4: note:
>     uninitialized use occurs here
>                      reject_agg, ctrl_agg_size, agg_size);
>                      ^~~~~~~~~~
> 
> Fixes: 2635664e6e4a ("rtlwifi: Add rx ampdu cfg for btcoexist.")
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>

Patch applied to wireless-drivers-next.git, thanks.

e4779162f737 rtlwifi: always initialize variables given to RT_TRACE()

-- 
https://patchwork.kernel.org/patch/10103995/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

      parent reply	other threads:[~2017-12-14 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-10 19:51 [PATCH 1/1] rtlwifi: always initialize variables given to RT_TRACE() Nicolas Iooss
     [not found] ` <20171210195159.7454-1-nicolas.iooss_linux-oWGTIYur0i8@public.gmane.org>
2017-12-11 17:34   ` Larry Finger
2017-12-14 12:44 ` Kalle Valo [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=20171214124413.A4A5560A60@smtp.codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.iooss_linux@m4x.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).