[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f21975fa-1a59-29cc-843d-550866d55345@kernel.org>
Date: Tue, 20 Dec 2016 07:31:44 -0700
From: Shuah Khan <shuah@...nel.org>
To: Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Valentina Manea <valentina.manea.m@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
Shuah Khan <shuahkh@....samsung.com>,
Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH] usbip: vudc: check for NULL before use
On 12/18/2016 03:44 PM, Sudip Mukherjee wrote:
> to_vep() is doing a container_of() on _ep. It is better to do the NULL
> check first and then use it.
>
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
> ---
> drivers/usb/usbip/vudc_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
> index 968471b..32ea604 100644
> --- a/drivers/usb/usbip/vudc_dev.c
> +++ b/drivers/usb/usbip/vudc_dev.c
> @@ -388,10 +388,10 @@ static int vep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
> unsigned long flags;
> int ret = 0;
>
> - ep = to_vep(_ep);
> if (!_ep)
> return -EINVAL;
Hmm. Linus's latest checks _ep and _req. Are you sure you are working
with the latest tree?
>
> + ep = to_vep(_ep);
> udc = ep_to_vudc(ep);
> if (!udc->driver)
> return -ESHUTDOWN;
>
thanks,
-- Shuah
Powered by blists - more mailing lists