struct dvb_usb_device *d = NULL;
struct dvb_usb_driver_info *driver_info =
(struct dvb_usb_driver_info *) id->driver_info;
- const struct dvb_usb_device_properties *props = driver_info->props;
+ const struct dvb_usb_device_properties *props;
int ret = -ENOMEM;
bool cold = false;
+ if (!id->driver_info) {
+ pr_err("%s: driver_info is null", KBUILD_MODNAME);
+ ret = -ENODEV;
+ goto err;
+ }
+
+ props = driver_info->props;
+
d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL);
if (d == NULL) {
err("no memory for 'struct dvb_usb_device'");
err_kfree:
kfree(d->priv);
kfree(d);
-
+err:
+ pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}