linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Kozlowski <mk@lab.zgora.pl>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: "Patrick Boettcher" <patrick.boettcher@dibcom.fr>,
	"Olivier Grenie" <olivier.grenie@dibcom.fr>,
	"Wolfram Sang" <w.sang@pengutronix.de>,
	"David Härdeman" <david@hardeman.nu>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Mariusz Kozlowski" <mk@lab.zgora.pl>
Subject: [PATCH] [media] dib0700: fix possible NULL pointer dereference
Date: Sat, 26 Mar 2011 19:23:56 +0100	[thread overview]
Message-ID: <1301163836-7601-1-git-send-email-mk@lab.zgora.pl> (raw)

Seems like 'adap->fe' test for NULL was meant to be before we dereference
that pointer.

Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
---
 drivers/media/dvb/dvb-usb/dib0700_devices.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 97af266..b48f1e0 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -2439,12 +2439,11 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap)
 
 	dib0700_set_i2c_speed(adap->dev, 340);
 	adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]);
-
-	dib7090_slave_reset(adap->fe);
-
 	if (adap->fe == NULL)
 		return -ENODEV;
 
+	dib7090_slave_reset(adap->fe);
+
 	return 0;
 }
 
-- 
1.7.0.4


             reply	other threads:[~2011-03-26 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 18:23 Mariusz Kozlowski [this message]
2011-04-03 15:44 ` [PATCH] [media] dib0700: fix possible NULL pointer dereference Patrick Boettcher

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=1301163836-7601-1-git-send-email-mk@lab.zgora.pl \
    --to=mk@lab.zgora.pl \
    --cc=david@hardeman.nu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=olivier.grenie@dibcom.fr \
    --cc=patrick.boettcher@dibcom.fr \
    --cc=w.sang@pengutronix.de \
    /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).