dereferencing uninitialized variable in anysee_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi I'm going through some smatch stuff and I had a question.

drivers/media/dvb/dvb-usb/anysee.c +482 anysee_probe(30)
	warn: variable dereferenced before check 'd'

   466          ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d,
   467                  adapter_nr);

	If we're in a cold state then dvb_usb_device_init() can return
	zero but d is uninitialized here.

   468          if (ret)
   469                  return ret;
   470
   471          alt = usb_altnum_to_altsetting(intf, 0);
   472          if (alt == NULL) {
   473                  deb_info("%s: no alt found!\n", __func__);
   474                  return -ENODEV;
   475          }
   476
   477          ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
                                        ^^^^^^^
	That would lead to an oops here.

   478                  alt->desc.bAlternateSetting);

I'm not sure how to fix this.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux