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.
Unified · Split
| @@ -2004,7 +2004,7 @@ static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, · 2003 unmodified lines | |||
| 2004 | cmd, reqtype, value, index, size); | 2004 | cmd, reqtype, value, index, size); |
| 2005 | 2005 | ||
| 2006 | if (size) { | 2006 | if (size) { |
| 2007 | buf = kmalloc(size, GFP_KERNEL); | 2007 | buf = kmalloc(size, GFP_NOIO); |
| 2008 | if (!buf) | 2008 | if (!buf) |
| 2009 | goto out; | 2009 | goto out; |
| 2010 | } | 2010 | } |
| @@ -2036,7 +2036,7 @@ static int __usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, · 25 unmodified lines | |||
| 2036 | cmd, reqtype, value, index, size); | 2036 | cmd, reqtype, value, index, size); |
| 2037 | 2037 | ||
| 2038 | if (data) { | 2038 | if (data) { |
| 2039 | buf = kmemdup(data, size, GFP_KERNEL); | 2039 | buf = kmemdup(data, size, GFP_NOIO); |
| 2040 | if (!buf) | 2040 | if (!buf) |
| 2041 | goto out; | 2041 | goto out; |
| 2042 | } else { | 2042 | } else { |