Return-path: Received: from zone0.gcu-squad.org ([212.85.147.21]:31231 "EHLO services.gcu-squad.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752959Ab0JHMdC (ORCPT ); Fri, 8 Oct 2010 08:33:02 -0400 Date: Fri, 8 Oct 2010 14:32:51 +0200 From: Jean Delvare To: Mauro Carvalho Chehab Cc: LMML Subject: Re: [PATCH] V4L/DVB: dib0700: Prevent NULL pointer dereference during probe Message-ID: <20101008143251.55fed758@endymion.delvare> In-Reply-To: <20100926162553.660281c6@endymion.delvare> References: <20100926162553.660281c6@endymion.delvare> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-ID: Sender: On Sun, 26 Sep 2010 16:25:53 +0200, Jean Delvare wrote: > Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that > dev->rc_input_dev is always set. It is, however, NULL if dvb-usb was > loaded with option disable_rc_polling=1. > > Signed-off-by: Jean Delvare > Cc: Mauro Carvalho Chehab > --- > drivers/media/dvb/dvb-usb/dib0700_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > --- linux-2.6.36-rc5.orig/drivers/media/dvb/dvb-usb/dib0700_core.c 2010-09-24 17:17:16.000000000 +0200 > +++ linux-2.6.36-rc5/drivers/media/dvb/dvb-usb/dib0700_core.c 2010-09-26 15:04:59.000000000 +0200 > @@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte > dev->props.rc.core.bulk_mode = false; > > /* Need a higher delay, to avoid wrong repeat */ > - dev->rc_input_dev->rep[REP_DELAY] = 500; > + if (dev->rc_input_dev) > + dev->rc_input_dev->rep[REP_DELAY] = 500; > > dib0700_rc_setup(dev); > The already applied commit 04cab131ce2a267b6777a98d68fbc0cae44d4ba8 (V4L/DVB: rc-core: increase repeat time) solves the problem in a different way, so you can ignore my patch above, it is no longer needed. -- Jean Delvare