summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2022-06-28 11:35:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-07 17:35:10 +0200
commit6ea9ef0941489b9e720430096594d04513c767fa (patch)
tree194bf9b19f5000d46874bb6751f40239dbd3766f /drivers/net/usb/usbnet.c
parent5596fd874087c9344e56779f059270f4bb92679e (diff)
downloadlinux-stable-6ea9ef0941489b9e720430096594d04513c767fa.tar.gz
linux-stable-6ea9ef0941489b9e720430096594d04513c767fa.tar.bz2
linux-stable-6ea9ef0941489b9e720430096594d04513c767fa.zip
usbnet: fix memory allocation in helpers
commit e65af5403e462ccd7dff6a045a886c64da598c2e upstream. usbnet provides some helper functions that are also used in the context of reset() operations. During a reset the other drivers on a device are unable to operate. As that can be block drivers, a driver for another interface cannot use paging in its memory allocations without risking a deadlock. Use GFP_NOIO in the helpers. Fixes: 877bd862f32b8 ("usbnet: introduce usbnet 3 command helpers") Signed-off-by: Oliver Neukum <oneukum@suse.com> Link: https://lore.kernel.org/r/20220628093517.7469-1-oneukum@suse.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r--drivers/net/usb/usbnet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 867cadb1e5cc..2aa28c961d26 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1998,7 +1998,7 @@ static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
cmd, reqtype, value, index, size);
if (size) {
- buf = kmalloc(size, GFP_KERNEL);
+ buf = kmalloc(size, GFP_NOIO);
if (!buf)
goto out;
}
@@ -2030,7 +2030,7 @@ static int __usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
cmd, reqtype, value, index, size);
if (data) {
- buf = kmemdup(data, size, GFP_KERNEL);
+ buf = kmemdup(data, size, GFP_NOIO);
if (!buf)
goto out;
} else {