From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751743AbeAZBvm (ORCPT ); Thu, 25 Jan 2018 20:51:42 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36802 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbeAZBvj (ORCPT ); Thu, 25 Jan 2018 20:51:39 -0500 X-Google-Smtp-Source: AH8x22488+2e95gkAGbKIVmiCfP7jeDMf9vkyzoFjrLJwW+hzk6XJWzlD6VXzSb6g5093D/k2W6yAQ== From: Jia-Ju Bai To: 3chas3@gmail.com Cc: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 2/2] atm: fore200e: Replace GFP_ATOMIC with GFP_KERNEL in fore200e_send Date: Fri, 26 Jan 2018 09:56:13 +0800 Message-Id: <1516931773-25222-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After checking all possible call chains to fore200e_send here, my tool finds that fore200e_send is never called in atomic context. And this function is assigned to a function pointer "dev->ops->send", which is only called by vcc_sendmsg (net/atm/common.c) through vcc->dev->ops->send, and vcc_sendmsg calls schedule, it indicates that fore200e_send can call functions which may sleep. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/atm/fore200e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 6ebc4e4..f6a5326 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -1611,7 +1611,7 @@ int bsq_audit(int where, struct host_bsq* bsq, int scheme, int magn) } if (tx_copy) { - data = kmalloc(tx_len, GFP_ATOMIC | GFP_DMA); + data = kmalloc(tx_len, GFP_KERNEL | GFP_DMA); if (data == NULL) { if (vcc->pop) { vcc->pop(vcc, skb); -- 1.7.9.5