Merge "USB: f_accessory: Check dev pointer before decoding ctrl request"
This commit is contained in:
commit
2e8cbd520c
1 changed files with 6 additions and 0 deletions
|
@ -887,6 +887,12 @@ int acc_ctrlrequest(struct usb_composite_dev *cdev,
|
||||||
u16 w_length = le16_to_cpu(ctrl->wLength);
|
u16 w_length = le16_to_cpu(ctrl->wLength);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If instance is not created which is the case in power off charging
|
||||||
|
* mode, dev will be NULL. Hence return error if it is the case.
|
||||||
|
*/
|
||||||
|
if (!dev)
|
||||||
|
return -ENODEV;
|
||||||
/*
|
/*
|
||||||
* printk(KERN_INFO "acc_ctrlrequest "
|
* printk(KERN_INFO "acc_ctrlrequest "
|
||||||
* "%02x.%02x v%04x i%04x l%u\n",
|
* "%02x.%02x v%04x i%04x l%u\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue