From: Krzysztof Opasiak <k.opasiak@samsung.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Valentina Manea <valentina.manea.m@gmail.com>,
Shuah Khan <shuah.kh@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
stern@rowland.harvard.edu
Subject: Re: [PATCH] usb: usbip: remove null check
Date: Mon, 06 Jun 2016 23:30:59 +0200 [thread overview]
Message-ID: <5755EB93.3030109@samsung.com> (raw)
In-Reply-To: <1465248212-5320-1-git-send-email-sudipm.mukherjee@gmail.com>
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
prev parent reply other threads:[~2016-06-06 21:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 21:23 [PATCH] usb: usbip: remove null check Sudip Mukherjee
2016-06-06 21:30 ` Krzysztof Opasiak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5755EB93.3030109@samsung.com \
--to=k.opasiak@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah.kh@samsung.com \
--cc=stern@rowland.harvard.edu \
--cc=sudipm.mukherjee@gmail.com \
--cc=valentina.manea.m@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox