* [PATCH 1/2] USB: mos7720: fix non-atomic allocation in write path
@ 2016-08-11 22:05 Alexey Khoroshilov
2016-08-11 22:05 ` [PATCH 2/2] USB: mos7840: " Alexey Khoroshilov
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2016-08-11 22:05 UTC (permalink / raw)
To: Johan Hovold
Cc: Alexey Khoroshilov, Greg Kroah-Hartman, linux-usb, linux-kernel,
ldv-project
There is an allocation with GFP_KERNEL flag in mos7720_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/mos7720.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 5608af4a369d..de9992b492b0 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1252,7 +1252,7 @@ static int mos7720_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);
+ GFP_ATOMIC);
if (!urb->transfer_buffer)
goto exit;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] USB: mos7840: fix non-atomic allocation in write path
2016-08-11 22:05 [PATCH 1/2] USB: mos7720: fix non-atomic allocation in write path Alexey Khoroshilov
@ 2016-08-11 22:05 ` Alexey Khoroshilov
2016-08-15 8:46 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2016-08-11 22:05 UTC (permalink / raw)
To: Johan Hovold
Cc: Alexey Khoroshilov, Greg Kroah-Hartman, linux-usb, linux-kernel,
ldv-project
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);
if (!urb->transfer_buffer)
goto exit;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] USB: mos7840: fix non-atomic allocation in write path
2016-08-11 22:05 ` [PATCH 2/2] USB: mos7840: " Alexey Khoroshilov
@ 2016-08-15 8:46 ` Johan Hovold
0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2016-08-15 8:46 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Johan Hovold, Greg Kroah-Hartman, linux-usb, linux-kernel,
ldv-project
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-15 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox