IB/usnic: Use GFP_ATOMIC under spinlock
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 20 Jan 2014 10:32:49 +0000 (13:32 +0300)
committerRoland Dreier <roland@purestorage.com>
Tue, 21 Jan 2014 18:47:56 +0000 (10:47 -0800)
This is called from qp_grp_and_vf_bind() and we are holding the
vf->lock so the allocation can't sleep.

Fixes: e3cf00d0a87f ('IB/usnic: Add Cisco VIC low-level hardware driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/usnic/usnic_uiom.c

index ae6934c..16755cd 100644 (file)
@@ -498,7 +498,7 @@ int usnic_uiom_attach_dev_to_pd(struct usnic_uiom_pd *pd, struct device *dev)
        struct usnic_uiom_dev *uiom_dev;
        int err;
 
-       uiom_dev = kzalloc(sizeof(*uiom_dev), GFP_KERNEL);
+       uiom_dev = kzalloc(sizeof(*uiom_dev), GFP_ATOMIC);
        if (!uiom_dev)
                return -ENOMEM;
        uiom_dev->dev = dev;