Received: by 10.223.176.46 with SMTP id f43csp79696wra; Thu, 25 Jan 2018 17:52:26 -0800 (PST) X-Google-Smtp-Source: AH8x225zIWpRyIsuLmv1ByJHQ9q7WDud2HyHPzOpWwGaBAO1p7d7tn0X2vVH5MzRy8jKzA1gzMUa X-Received: by 2002:a17:902:bb0a:: with SMTP id l10-v6mr9133031pls.130.1516931546501; Thu, 25 Jan 2018 17:52:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516931546; cv=none; d=google.com; s=arc-20160816; b=dCuHv79fUtcabIzlFbHrOFy+XzovTM/JisdhyhUz4nDy+/lqn6NrkQQLaa8Em5HD13 14lUoYcntpDnrcK1mvGW1QTKzYKngBim7E1tQsuePhEkBIWeABFFvT/xaGLCkgqys1kp kzTr0wbWgul7i8u2ubb4abcPPnCVNUWq1eQDQBLID8WwOk/BcmubfaTLdaAPtVxq9I41 iU7peRYawcMh2jlxSV7ZkEHDVcRupxxNO84HlY34Z9bmZTMw3pXDzmbF8MwxirEjHayh JtPLNq3EGgOtVIOEIGWawbSfl0wiqhc/0xR9VNiJEskq6zAUHl0+gPLetHwpTeypnLvv xi3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VeiWUa/6MUORIQo++l7WLyV59VGUDUI9uhLRU722Z/U=; b=SrMMyLbvw1uiyXgLscws6sJM07AT2wJpfx1+wXeeGqxMLJ6Sa89IfrUcwB7PneaaF4 XY2KRJdDl+STdWLNwEDBtZVvV2gWhg7fWaoFEwgyN3QP41X8+S4FKkQ8PpA6JaY05eIW 753aiNj/IDMrLGOD1377SOgic5jgj+5kCKJWeLPx1u1HRpg891+dpIWE8TtTKE2kB943 Bey2q252sJGw/9VVNGnc1DCeDW7+i5FLhaBlamMnBtHs3ZOraVqrhOhpBlwCZEtoORmY GpCLfWZw5Su6naXKoBowolkQm52y1wY1g5O8jlXQEcZ0niN4pLn2Rr6Oa60+YDi7iO94 Zw8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rGXKQ/Ob; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2-v6si2933152plz.168.2018.01.25.17.52.12; Thu, 25 Jan 2018 17:52:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rGXKQ/Ob; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbeAZBvm (ORCPT + 99 others); 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 Received: by mail-pg0-f66.google.com with SMTP id k68so6280784pga.3; Thu, 25 Jan 2018 17:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=VeiWUa/6MUORIQo++l7WLyV59VGUDUI9uhLRU722Z/U=; b=rGXKQ/Obk0mQ6lh2Cx4Vbj9YwPoW2XKt6KKqYFOB1pGA9FeD0+n7oKwzaRYjHDC6z+ cvsMs+bqkuvaoO3mp7mF1uiYJNHeoREKGQlc7I3z+Ej4EvwkygguMnahHCjnFKY4Uuyr 38PW6BbcvS0m/6KRlcsi8fCOE1dyJXIvksa/mG4Y3VCTNhLdigmdVoaO623fz5gP/wj5 Aw5slUNTYFglvuOzxeykKFA3MIyUNQD4txb7lorXE4Xc/NTUErRQkw8e8r87bVYDhtAs fnU0G+Jf8ggeszqw4CTHhbrgnkUExskOmV1rKWKhVBm90q5lGJtNY1kpbPTJV7Aiy0dA JZ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VeiWUa/6MUORIQo++l7WLyV59VGUDUI9uhLRU722Z/U=; b=ocxtBD5m4IKvuDaU40KZ8SyZ0ww2RAR27UBcu6TMF1MZhMin0nyiQT4WFPDRJPWtLW xO+NaDVu83KDiO7oe6xpb7ag0VWpBoa9wjdkoSncz0CkFPTZmrK8YEn5Kayqvbdeo2Qt w7r1C8rDKYdFZ/vpsUbOkvBwU/Dlhc2rirHx433QB4Bdoj+y3dI0OMQdWvjZFoEBYfcT C75xM/qBDH2MMamCs8EISxt2OdyAhry0MsHYdVXHP5ow+/5XmXwWRPgJcl9WmW8Oal3p TiwFg1nPjfyvNncSqD88pIG5AJitrcxI6FYt8+Mw6ReyjT207vWeyZS8Y+/JvwlJadkC 9ifw== X-Gm-Message-State: AKwxytfYhVaVx2FWVECIJeWcmVkOiu8IO8PBJZZq6GrnzEgSb3xqajU4 NnhMzvU6u87GK4sUg9ftpZ8= X-Received: by 10.98.72.19 with SMTP id v19mr17960078pfa.107.1516931499311; Thu, 25 Jan 2018 17:51:39 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id u25sm14811257pfh.142.2018.01.25.17.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 17:51:38 -0800 (PST) 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 Precedence: bulk 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