Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517092

Re: [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Sean Young <sean@mess.org>
Newsgroups linux.kernel
Subject Re: [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()
Date Tue, 08 Nov 2016 12:30:02 +0100
Message-ID <sBcLf-eL-7@gated-at.bofh.it> (permalink)
References <sAUlk-4ZD-7@gated-at.bofh.it> <sAUlk-4ZD-33@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Cc mchehab@kernel.org, wsa-dev@sang-engineering.com, gregkh@linuxfoundation.org, keescook@chromium.org, akpm@linux-foundation.org, patrick.boettcher@posteo.de, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Tue, 8 Nov 2016 11:23:42 +0000
X-Original-Message-ID <20161108112341.GA20598@gofer.mess.org>
X-Original-References <20161107154114.26803-1-shuahkh@osg.samsung.com> <20161107154114.26803-2-shuahkh@osg.samsung.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1517092

Show key headers only | View raw


On Mon, Nov 07, 2016 at 08:41:12AM -0700, Shuah Khan wrote:
> Fix the following uninitialized variable compiler warning:
> 
> drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
>  drivers/media/usb/dvb-usb/dib0700_core.c:763:2: warning: ‘protocol’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>    rc_keydown(d->rc_dev, protocol, keycode, toggle);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  drivers/media/usb/dvb-usb/dib0700_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
> index f319665..cfe28ec 100644
> --- a/drivers/media/usb/dvb-usb/dib0700_core.c
> +++ b/drivers/media/usb/dvb-usb/dib0700_core.c
> @@ -676,7 +676,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
>  {
>  	struct dvb_usb_device *d = purb->context;
>  	struct dib0700_rc_response *poll_reply;
> -	enum rc_type protocol;
> +	enum rc_type protocol = RC_TYPE_UNKNOWN;
>  	u32 uninitialized_var(keycode);
>  	u8 toggle;
>  

There is another (better) fix for it here:

https://patchwork.linuxtv.org/patch/37516/


Thanks
Sean

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion() Shuah Khan <shuahkh@osg.samsung.com> - 2016-11-07 16:50 +0100
  Re: [PATCH] media: fix uninitialized variable warning in  dib0700_rc_urb_completion() Sean Young <sean@mess.org> - 2016-11-08 12:30 +0100

csiph-web