Message ID | 1476366699-21611-1-git-send-email-geert@linux-m68k.org (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1bugQF-0008JR-Kd; Thu, 13 Oct 2016 13:51:47 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-7) with esmtp id 1bugQC-0000RN-3B; Thu, 13 Oct 2016 15:51:46 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932312AbcJMNvm (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 13 Oct 2016 09:51:42 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:48244 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932274AbcJMNvl (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 13 Oct 2016 09:51:41 -0400 Received: from ayla.of.borg ([84.193.137.253]) by baptiste.telenet-ops.be with bizsmtp id v1re1t0025UCtCs011reca; Thu, 13 Oct 2016 15:51:38 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from <geert@linux-m68k.org>) id 1bugQ5-0006v6-Bn; Thu, 13 Oct 2016 15:51:37 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from <geert@linux-m68k.org>) id 1bugQ8-0005dA-Pe; Thu, 13 Oct 2016 15:51:40 +0200 From: Geert Uytterhoeven <geert@linux-m68k.org> To: Sean Young <sean@mess.org>, Mauro Carvalho Chehab <mchehab@s-opensource.com> Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org> Subject: [PATCH] [media] dib0700: Fix uninitialized protocol for NEC repeat codes Date: Thu, 13 Oct 2016 15:51:39 +0200 Message-Id: <1476366699-21611-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.10.13.133917 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0' |
Commit Message
Geert Uytterhoeven
Oct. 13, 2016, 1:51 p.m. UTC
drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function
When receiving an NEC repeat code, protocol is indeed not initialized.
Set it to RC_TYPE_NECX to fix this.
Fixes: 2ceeca0499d74521 ("[media] rc: split nec protocol into its three variants")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Is RC_TYPE_NECX correct, or should it be RC_TYPE_NEC?
I used RC_TYPE_NECX based on the checks for {,not_}data and
{,not_}system for the other cases.
---
drivers/media/usb/dvb-usb/dib0700_core.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Thu, Oct 13, 2016 at 03:51:39PM +0200, Geert Uytterhoeven wrote: > drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’: > drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function > > When receiving an NEC repeat code, protocol is indeed not initialized. > Set it to RC_TYPE_NECX to fix this. > > Fixes: 2ceeca0499d74521 ("[media] rc: split nec protocol into its three variants") > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> > --- > Is RC_TYPE_NECX correct, or should it be RC_TYPE_NEC? > I used RC_TYPE_NECX based on the checks for {,not_}data and > {,not_}system for the other cases. It should be the protocol that the last scancode was received with. This code path is very broken; it calls: rc_keydown(d->rc_dev, protocol, keycode, toggle); But keycode in this codepath is never set. Luckily keycode is declared as: u32 uninitialized_var(keycode); I've got another patch for this which I'll send as a reply to this. Sean > --- > drivers/media/usb/dvb-usb/dib0700_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c > index f3196658fb700706..5878ae4d20ad27ed 100644 > --- a/drivers/media/usb/dvb-usb/dib0700_core.c > +++ b/drivers/media/usb/dvb-usb/dib0700_core.c > @@ -718,6 +718,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) > poll_reply->nec.data == 0x00 && > poll_reply->nec.not_data == 0xff) { > poll_reply->data_state = 2; > + protocol = RC_TYPE_NECX; > break; > } > > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c index f3196658fb700706..5878ae4d20ad27ed 100644 --- a/drivers/media/usb/dvb-usb/dib0700_core.c +++ b/drivers/media/usb/dvb-usb/dib0700_core.c @@ -718,6 +718,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) poll_reply->nec.data == 0x00 && poll_reply->nec.not_data == 0xff) { poll_reply->data_state = 2; + protocol = RC_TYPE_NECX; break; }