Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1415474 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2016-06-06 23:30 +0200 |
| Last post | 2016-06-06 23:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] usb: usbip: remove null check Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-06-06 23:30 +0200
Re: [PATCH] usb: usbip: remove null check Krzysztof Opasiak <k.opasiak@samsung.com> - 2016-06-06 23:40 +0200
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2016-06-06 23:30 +0200 |
| Subject | [PATCH] usb: usbip: remove null check |
| Message-ID | <rHafU-1OH-33@gated-at.bofh.it> |
The only caller of get_gadget_descs() has already dereferenced udc before calling this function, so udc can not be NULL at this point of the code and hence no use of checking it. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> --- drivers/usb/usbip/vudc_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c index 99397fa..0f98f2c 100644 --- a/drivers/usb/usbip/vudc_sysfs.c +++ b/drivers/usb/usbip/vudc_sysfs.c @@ -40,7 +40,7 @@ int get_gadget_descs(struct vudc *udc) struct usb_ctrlrequest req; int ret; - if (!udc || !udc->driver || !udc->pullup) + if (!udc->driver || !udc->pullup) return -EINVAL; req.bRequestType = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; -- 1.9.1
[toc] | [next] | [standalone]
| From | Krzysztof Opasiak <k.opasiak@samsung.com> |
|---|---|
| Date | 2016-06-06 23:40 +0200 |
| Message-ID | <rHapA-1UM-7@gated-at.bofh.it> |
| In reply to | #1415474 |
On 06/06/2016 11:23 PM, Sudip Mukherjee wrote: > The only caller of get_gadget_descs() has already dereferenced udc > before calling this function, so udc can not be NULL at this point of > the code and hence no use of checking it. > > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> > --- > drivers/usb/usbip/vudc_sysfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c > index 99397fa..0f98f2c 100644 > --- a/drivers/usb/usbip/vudc_sysfs.c > +++ b/drivers/usb/usbip/vudc_sysfs.c > @@ -40,7 +40,7 @@ int get_gadget_descs(struct vudc *udc) > struct usb_ctrlrequest req; > int ret; > > - if (!udc || !udc->driver || !udc->pullup) > + if (!udc->driver || !udc->pullup) > return -EINVAL; > > req.bRequestType = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; > Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com> -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web