@@ -98,7 +98,7 @@ int usnic_fwd_add_usnic_filter(struct usnic_fwd_dev *ufdev, int vnic_idx,
return -ENOMEM;
}
- usnic_filter_hndl = kzalloc(sizeof(*usnic_filter_hndl), GFP_KERNEL);
+ usnic_filter_hndl = kzalloc(sizeof(*usnic_filter_hndl), GFP_ATOMIC);
if (!usnic_filter_hndl) {
usnic_err("Failed to allocate memory for hndl\n");
pci_free_consistent(pdev, tlv_size, tlv, tlv_pa);
@@ -346,7 +346,7 @@ alloc_res_chunk_list(struct usnic_vnic *vnic,
}
res_chunk_list = kzalloc(sizeof(*res_chunk_list)*(res_lst_sz+1),
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!res_chunk_list)
return ERR_PTR(-ENOMEM);
@@ -464,7 +464,7 @@ usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev,
return ERR_PTR(-EINVAL);
}
- qp_grp = kzalloc(sizeof(*qp_grp), GFP_KERNEL);
+ qp_grp = kzalloc(sizeof(*qp_grp), GFP_ATOMIC);
if (!qp_grp) {
usnic_err("Unable to alloc qp_grp - Out of memory\n");
return NULL;
@@ -39,7 +39,7 @@ usnic_uiom_interval_node_alloc(long int start, long int last, int ref_cnt,
int flags)
{
struct usnic_uiom_interval_node *interval = kzalloc(sizeof(*interval),
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!interval)
return NULL;
@@ -225,14 +225,14 @@ usnic_vnic_get_resources(struct usnic_vnic *vnic, enum usnic_vnic_res_type type,
if (usnic_vnic_res_free_cnt(vnic, type) < cnt || cnt < 1 || !owner)
return ERR_PTR(-EINVAL);
- ret = kzalloc(sizeof(*ret), GFP_KERNEL);
+ ret = kzalloc(sizeof(*ret), GFP_ATOMIC);
if (!ret) {
usnic_err("Failed to allocate chunk for %s - Out of memory\n",
usnic_vnic_pci_name(vnic));
return ERR_PTR(-ENOMEM);
}
- ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_KERNEL);
+ ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_ATOMIC);
if (!ret->res) {
usnic_err("Failed to allocate resources for %s. Out of memory\n",
usnic_vnic_pci_name(vnic));
usNIC code at few places, calls kzalloc with GFP_KERNEL flag while holding a spinlock. Change GPF_KERNEL to GFP_ATOMIC at such places. Signed-off-by: Upinder Malhi <umalhi@cisco.com> --- drivers/infiniband/hw/usnic/usnic_fwd.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c | 2 +- drivers/infiniband/hw/usnic/usnic_vnic.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)