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>
This commit is contained in:
parent
128fe95d77
commit
8b0d7048dc
|
@ -463,6 +463,11 @@ static int anysee_probe(struct usb_interface *intf,
|
||||||
if (intf->num_altsetting < 1)
|
if (intf->num_altsetting < 1)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Anysee is always warm (its USB-bridge, Cypress FX2, uploads
|
||||||
|
* firmware from eeprom). If dvb_usb_device_init() succeeds that
|
||||||
|
* means d is a valid pointer.
|
||||||
|
*/
|
||||||
ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d,
|
ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d,
|
||||||
adapter_nr);
|
adapter_nr);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -479,10 +484,7 @@ static int anysee_probe(struct usb_interface *intf,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (d)
|
return anysee_init(d);
|
||||||
ret = anysee_init(d);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct usb_device_id anysee_table[] = {
|
static struct usb_device_id anysee_table[] = {
|
||||||
|
|
Loading…
Reference in New Issue