From: Yufeng Mo Date: Mon, 29 Jul 2019 02:53:25 +0000 (+0800) Subject: net: hns3: change GFP flag during lock period X-Git-Tag: v5.4-rc1~131^2~342^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d659f9f60f6a119654c65bfa58aa6fa762c0824d;p=thirdparty%2Flinux.git net: hns3: change GFP flag during lock period When allocating memory, the GFP_KERNEL cannot be used during the spin_lock period. This is because it may cause scheduling when holding spin_lock. This patch changes GFP flag to GFP_ATOMIC in this case. Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director") Signed-off-by: Yufeng Mo Signed-off-by: lipeng 00277521 Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 3c64d70df4d46..14199c455ddcf 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5796,7 +5796,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, return -ENOSPC; } - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc(sizeof(*rule), GFP_ATOMIC); if (!rule) { spin_unlock_bh(&hdev->fd_rule_lock);