usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()

This change “usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()” (commit 6c0f369) in Linux kernel is authored by Alexey Khoroshilov <khoroshilov [at] ispras.ru> on Thu Jun 19 23:44:57 2014 +0400.

Description of "usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()"

The change “usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()” introduces changes as follows.

usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()

As far as kzalloc() is called with spinlock held,
we have to pass GFP_ATOMIC regardless of mem_flags argument.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 6c0f369

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/usb/host/max3421-hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 6dbf1e9c137c..6234c75da33f 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1547,7 +1547,7 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 	max3421_ep = urb->ep->hcpriv;
 	if (!max3421_ep) {
 		/* gets freed in max3421_endpoint_disable: */
-		max3421_ep = kzalloc(sizeof(struct max3421_ep), mem_flags);
+		max3421_ep = kzalloc(sizeof(struct max3421_ep), GFP_ATOMIC);
 		if (!max3421_ep) {
 			retval = -ENOMEM;
 			goto out;

The commit for this change in Linux stable tree is 6c0f369 (patch).

Last modified: 2020/02/10