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 <[email protected]>
---
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 858efcfda50b..ed22424dbec7 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1551,7 +1551,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;
--
1.9.1
On Thu, Jun 19, 2014 at 1:44 PM, Alexey Khoroshilov
<[email protected]> wrote:
> As far as kzalloc() is called with spinlock held,
> we have to pass GFP_ATOMIC regardless of mem_flags argument.
Good catch, thanks!
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <[email protected]>
Acked-by: David Mosberger <[email protected]>
> ---
> 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 858efcfda50b..ed22424dbec7 100644
> --- a/drivers/usb/host/max3421-hcd.c
> +++ b/drivers/usb/host/max3421-hcd.c
> @@ -1551,7 +1551,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;
> --
> 1.9.1
>
--
eGauge Systems LLC, http://egauge.net/, 1.877-EGAUGE1, fax 720.545.9768