diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-31 15:27:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:27:54 -0400 |
commit | 8b0d7048dc2f0d2e4344bc8aaf85b4f14196145f (patch) | |
tree | 47b9501f77469046268bc57345d41639b1489c83 /drivers/media/dvb/dvb-usb | |
parent | 128fe95d77d6c5239ce6af6c3edacafc79eb0a39 (diff) |
V4L/DVB: remove unneeded null check in anysee_probe()
Smatch complained because "d" is dereferenced first and then checked for
null later . The only code path where "d" could be a invalid pointer is
if this is a cold device in dvb_usb_device_init(). I consulted Antti
Palosaari and he explained that anysee is always a warm device.
I have added a comment and removed the unneeded null check.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/anysee.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index faca1ad88a67..aa5c7d5eef69 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -463,6 +463,11 @@ static int anysee_probe(struct usb_interface *intf, | |||
463 | if (intf->num_altsetting < 1) | 463 | if (intf->num_altsetting < 1) |
464 | return -ENODEV; | 464 | return -ENODEV; |
465 | 465 | ||
466 | /* | ||
467 | * Anysee is always warm (its USB-bridge, Cypress FX2, uploads | ||
468 | * firmware from eeprom). If dvb_usb_device_init() succeeds that | ||
469 | * means d is a valid pointer. | ||
470 | */ | ||
466 | ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d, | 471 | ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d, |
467 | adapter_nr); | 472 | adapter_nr); |
468 | if (ret) | 473 | if (ret) |
@@ -479,10 +484,7 @@ static int anysee_probe(struct usb_interface *intf, | |||
479 | if (ret) | 484 | if (ret) |
480 | return ret; | 485 | return ret; |
481 | 486 | ||
482 | if (d) | 487 | return anysee_init(d); |
483 | ret = anysee_init(d); | ||
484 | |||
485 | return ret; | ||
486 | } | 488 | } |
487 | 489 | ||
488 | static struct usb_device_id anysee_table[] = { | 490 | static struct usb_device_id anysee_table[] = { |