From: 谢泓宇 <xiehongyu1@kylinos.cn>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
Hongyu Xie <xy521521@gmail.com>,
gregkh@linuxfoundation.org, mathias.nyman@intel.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH -next v2] xhci: fix two places when dealing with return value of function xhci_check_args
Date: Thu, 10 Feb 2022 09:04:40 +0800 [thread overview]
Message-ID: <59231732-82a3-3a0c-db0c-eec252b35d3b@kylinos.cn> (raw)
In-Reply-To: <89d59749-8ca3-b30b-4da6-a6e567528d1b@linux.intel.com>
Hi,
On 2022/2/9 17:29, Mathias Nyman wrote:
> On 9.2.2022 4.52, Hongyu Xie wrote:
>> From: Hongyu Xie <xiehongyu1@kylinos.cn>
>>
>> xhci_check_args returns 4 types of value, -ENODEV, -EINVAL, 1 and 0.
>> xhci_urb_enqueue and xhci_check_streams_endpoint return -EINVAL if
>> the return value of xhci_check_args <= 0.
>> This will cause a problem.
>> For example, r8152_submit_rx calling usb_submit_urb in
>> drivers/net/usb/r8152.c.
>> r8152_submit_rx will never get -ENODEV after submiting an urb
>> when xHC is halted,
>> because xhci_urb_enqueue returns -EINVAL in the very beginning.
>>
>> Fixes: 203a86613fb3 ("xhci: Avoid NULL pointer deref when host dies.")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hongyu Xie <xiehongyu1@kylinos.cn>
>> ---
> Thanks, added to queue.
> Changed the commit message and header a bit:
>
> "xhci: Prevent futile URB re-submissions due to incorrect return value.
>
> The -ENODEV return value from xhci_check_args() is incorrectly changed
> to -EINVAL in a couple places before propagated further.
>
> xhci_check_args() returns 4 types of value, -ENODEV, -EINVAL, 1 and 0.
> xhci_urb_enqueue and xhci_check_streams_endpoint return -EINVAL if
> the return value of xhci_check_args <= 0.
> This causes problems for example r8152_submit_rx, calling usb_submit_urb
> in drivers/net/usb/r8152.c.
> r8152_submit_rx will never get -ENODEV after submiting an urb when xHC
> is halted because xhci_urb_enqueue returns -EINVAL in the very beginning."
>
> Let me know if you disagree with this.
>
> Thanks
> -Mathias
Sounds good to me.
Do I have to send another patch with commit message and header changed?
Thanks
Hongyu Xie
next prev parent reply other threads:[~2022-02-10 1:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 2:52 Hongyu Xie
2022-02-09 9:29 ` Mathias Nyman
2022-02-10 1:04 ` 谢泓宇 [this message]
2022-02-10 8:18 ` Mathias Nyman
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=59231732-82a3-3a0c-db0c-eec252b35d3b@kylinos.cn \
--to=xiehongyu1@kylinos.cn \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=mathias.nyman@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=xy521521@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
all inboxes | Powered by JetHome®