From: Johan Hovold <johan@kernel.org>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH 2/2] USB: mos7840: fix non-atomic allocation in write path
Date: Mon, 15 Aug 2016 10:46:39 +0200 [thread overview]
Message-ID: <20160815084639.GA2226@localhost> (raw)
In-Reply-To: <1470953109-4280-2-git-send-email-khoroshilov@ispras.ru>
On Fri, Aug 12, 2016 at 01:05:09AM +0300, Alexey Khoroshilov wrote:
> There is an allocation with GFP_KERNEL flag in mos7840_write(),
> while it may be called from interrupt context.
>
> Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path")
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/usb/serial/mos7840.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
> index ed378fb232e7..1de2c01c078d 100644
> --- a/drivers/usb/serial/mos7840.c
> +++ b/drivers/usb/serial/mos7840.c
> @@ -1341,7 +1341,7 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
>
> if (urb->transfer_buffer == NULL) {
> urb->transfer_buffer =
> - kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
> + kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
Both patches now applied. I fixed up the odd indentation here while at
it.
Thanks,
Johan
prev parent reply other threads:[~2016-08-15 8:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 22:05 [PATCH 1/2] USB: mos7720: fix non-atomic allocation in write path Alexey Khoroshilov
2016-08-11 22:05 ` [PATCH 2/2] USB: mos7840: " Alexey Khoroshilov
2016-08-15 8:46 ` Johan Hovold [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=20160815084639.GA2226@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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