qed: Fix possible system hang in the dcbnl-getdcbx() path.
author[email protected] <[email protected]>
Wed, 19 Apr 2017 10:19:54 +0000 (03:19 -0700)
committerDavid S. Miller <[email protected]>
Thu, 20 Apr 2017 20:29:40 +0000 (16:29 -0400)
qed_dcbnl_get_dcbx() API uses kmalloc in GFT_KERNEL mode. The API gets
invoked in the interrupt context by qed_dcbnl_getdcbx callback. Need
to invoke this kmalloc in atomic mode.

Signed-off-by: Sudarsana Reddy Kalluru <[email protected]>
Signed-off-by: Yuval Mintz <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/qlogic/qed/qed_dcbx.c

index ff058a380003c2737ee1f31f638030da59314e1f..8f0783a62953f063b99a693c5232405250d9a79c 100644 (file)
@@ -1264,7 +1264,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
 {
        struct qed_dcbx_get *dcbx_info;
 
-       dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
+       dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
        if (!dcbx_info)
                return NULL;