All of lore.kernel.org
 help / color / mirror / Atom feed
From: shuah <shuah@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>,
	Shuah Khan <skhan@linuxfoundation.org>
Cc: valentina.manea.m@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, shuah <shuah@kernel.org>
Subject: Re: [PATCH] usbip: Fix vep_free_request() null pointer checks on input args
Date: Tue, 22 Jan 2019 16:05:28 -0700	[thread overview]
Message-ID: <0b87d2b7-3200-7f6f-c4ee-e9e1fe6161fe@kernel.org> (raw)
In-Reply-To: <20190119081708.GA8204@kroah.com>

On 1/19/19 1:17 AM, Greg KH wrote:
> On Fri, Jan 18, 2019 at 02:29:30PM -0700, Shuah Khan wrote:
>> From: Shuah Khan <shuah@kernel.org>
>>
>> Fix vep_free_request() to return when usb_ep and usb_request are null
>> instead of calling WARN_ON.
>>
>> Signed-off-by: Shuah Khan <shuah@kernel.org>
>> ---
>>   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 1634d8698e15..bfc8218e3fb6 100644
>> --- a/drivers/usb/usbip/vudc_dev.c
>> +++ b/drivers/usb/usbip/vudc_dev.c
>> @@ -297,7 +297,7 @@ static void vep_free_request(struct usb_ep *_ep, struct usb_request *_req)
>>   {
>>   	struct vrequest *req;
>>   
>> -	if (WARN_ON(!_ep || !_req))
>> +	if (!_ep || !_req)
> 
> It's impossible for _ep to be NULL in this callback (see
> usb_ep_free_request() for where this is called from to prove that), so I
> don't think you need to check that.  It's almost impossible for _req to
> be NULL, so you might as well leave that check in.
> 

Yes. ep can never be null here in vep_free_request(). I will leave
this alone.

thanks,
-- Shuah




WARNING: multiple messages have this Message-ID (diff)
From: Shuah Khan <shuah@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>,
	Shuah Khan <skhan@linuxfoundation.org>
Cc: valentina.manea.m@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, shuah <shuah@kernel.org>
Subject: usbip: Fix vep_free_request() null pointer checks on input args
Date: Tue, 22 Jan 2019 16:05:28 -0700	[thread overview]
Message-ID: <0b87d2b7-3200-7f6f-c4ee-e9e1fe6161fe@kernel.org> (raw)

On 1/19/19 1:17 AM, Greg KH wrote:
> On Fri, Jan 18, 2019 at 02:29:30PM -0700, Shuah Khan wrote:
>> From: Shuah Khan <shuah@kernel.org>
>>
>> Fix vep_free_request() to return when usb_ep and usb_request are null
>> instead of calling WARN_ON.
>>
>> Signed-off-by: Shuah Khan <shuah@kernel.org>
>> ---
>>   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 1634d8698e15..bfc8218e3fb6 100644
>> --- a/drivers/usb/usbip/vudc_dev.c
>> +++ b/drivers/usb/usbip/vudc_dev.c
>> @@ -297,7 +297,7 @@ static void vep_free_request(struct usb_ep *_ep, struct usb_request *_req)
>>   {
>>   	struct vrequest *req;
>>   
>> -	if (WARN_ON(!_ep || !_req))
>> +	if (!_ep || !_req)
> 
> It's impossible for _ep to be NULL in this callback (see
> usb_ep_free_request() for where this is called from to prove that), so I
> don't think you need to check that.  It's almost impossible for _req to
> be NULL, so you might as well leave that check in.
> 

Yes. ep can never be null here in vep_free_request(). I will leave
this alone.

thanks,
-- Shuah

  reply	other threads:[~2019-01-22 23:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 21:29 [PATCH] usbip: Fix vep_free_request() null pointer checks on input args Shuah Khan
2019-01-18 21:29 ` Shuah Khan
2019-01-18 21:29 ` [PATCH] usbip: Fix vhci_urb_enqueue() URB null transfer buffer error path Shuah Khan
2019-01-18 21:29   ` Shuah Khan
2019-01-19  8:21   ` [PATCH] " Greg KH
2019-01-19  8:21     ` Greg Kroah-Hartman
2019-01-19 16:58   ` [PATCH] " Sergei Shtylyov
2019-01-19 16:58     ` Sergei Shtylyov
2019-01-20 19:29     ` [PATCH] " shuah
2019-01-20 19:29       ` Shuah Khan
2019-01-19  8:17 ` [PATCH] usbip: Fix vep_free_request() null pointer checks on input args Greg KH
2019-01-19  8:17   ` Greg Kroah-Hartman
2019-01-22 23:05   ` shuah [this message]
2019-01-22 23:05     ` Shuah Khan
2019-01-25  8:02     ` [PATCH] " Greg KH
2019-01-25  8:02       ` Greg Kroah-Hartman
2019-01-25 14:26       ` [PATCH] " shuah
2019-01-25 14:26         ` Shuah Khan
2019-01-25 16:05 [PATCH] " Shuah Khan

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=0b87d2b7-3200-7f6f-c4ee-e9e1fe6161fe@kernel.org \
    --to=shuah@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.