Received: by 10.223.176.46 with SMTP id f43csp376870wra; Thu, 25 Jan 2018 23:56:55 -0800 (PST) X-Google-Smtp-Source: AH8x224XgEZzhzfHYeKmUjk4V8/dqa35BdhORFapWlAt8EzivFuxizT/xuNvmG8WaNITu2NFy6rB X-Received: by 10.99.151.74 with SMTP id d10mr11631728pgo.258.1516953415328; Thu, 25 Jan 2018 23:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516953415; cv=none; d=google.com; s=arc-20160816; b=h3Crph7GLYmTz2gG4sKtuonNNqkLNizNyfqcmHx+8OB1L4BOct9AiguVNeXkvmHvhj qh8L3qVGH9NLxpzW8bFTnp9uHJIUfY/QTo+dr12YPWCc0tUHNUrtWn7AFvfvK58UhkvF ISb4v5tjpP6PZ9HGQCX64MVnmegsn6zgcnHBBAl89627auCqrFpNPGxVb855nfx7O6Q/ ZCiWX43//lZhzP+A6i2Kt6cJR8DLJtdFgepJ2I8GPHQz6JN60uK/0ezpuRQDtTydH29k elZiwEYdqDS1jMF/VnUIJt3l7w+JfuqxJEPFH7HvLjRmQ5qVa0/zf3KoOX8Px9RPq2LO X3ww== 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=GQtm0gnmqItvPXa/rekZ3PITPFutx0ksKfmbfQpULhQ=; b=MCcBoR8NHMwCtK4Zb/WoSPmBmwZFu4UTVvsUVFcj1gGooqAaR6P7v9yZunwGt4Mwq/ DUABW6RnY2U3mbC3Vd1UWJ06FnrU20cj5aJfBDwpw9RIczUcSuq/5ZvafjD1V+Sh1YgQ 9b+i+yc2p3HviU7nKMba9CYLZazshVsEWY5VcGhh/IHcYKyqPovl2JR4JEw5y+24xZ12 mXp8sSBMT05fYlY8LvV0Ka0AULs9FsSxPFoMrDQHpX/h5LHqjHcSXb9C5t56op3PVOr8 7+Rkuz+WQdqy7W30G1Y8grZClLxPwJQQB4MNX+w08aWSmS1E+kSQ1swd2ZwRHxbCinNG gjnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tz3IKqcn; 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 d6-v6si2996281pll.273.2018.01.25.23.56.40; Thu, 25 Jan 2018 23:56:55 -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=tz3IKqcn; 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 S1752158AbeAZH4K (ORCPT + 99 others); Fri, 26 Jan 2018 02:56:10 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34935 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbeAZH4I (ORCPT ); Fri, 26 Jan 2018 02:56:08 -0500 Received: by mail-pf0-f194.google.com with SMTP id t12so7774875pfg.2; Thu, 25 Jan 2018 23:56:08 -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=GQtm0gnmqItvPXa/rekZ3PITPFutx0ksKfmbfQpULhQ=; b=tz3IKqcnpbxtoCC49W54Y+EK8lhfa8ROv9+6te/D64HDoq3gViojWUpGjr1nefGa9S FNxQuGlhURuUliXpNB2+T+TWyc/KH/GqD3A/kURW23V1g45zV1sIjCnbDhJ3hI73FOSM rRwGn7fq3hO8LAlaWJz14VwJP2iYl1RNJPKw5QQgAXMlNTxuDTgE4KvEV6b8MNWt/PxL 5WS7jSG8izzGqDno9mdUOc+15UU+EpCx749lQC493aQavjMvR00z1BH+7nG/QUpKibIr pxemWa7hf9t7VycgZnqvJYBD8h1eNRG47K9xwdLkxaArOQiWia7YEZzxtDGq+uHp1Voi 6jEg== 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=GQtm0gnmqItvPXa/rekZ3PITPFutx0ksKfmbfQpULhQ=; b=TDJF2J4rvVnuifp6ujjL4OR6hgI9oIdfpYb7mQxS6Rig4l3vmsGZf+NaBY5taBytbT 3JCy0CRkvHOYOlAQfsNat3GPnn58K+/cXs+SqGnlELfE7nmr/dj4IybPcO71APKqtD5P TMbkI2KHKiEUXjB1WcNCedF8KRN8QJvsv6cJWYhVX462QRubL8eMGDkVyWbauSkoy/R9 6dPD/VcveudO3I0zpDnk/0uclbEj0oPgwKKRIhAOOblkc1PuG17rqla6Go9X0DtEw/Bh bQ+/vWioMkhte/QiNqSXec2aqai+txkZ4CVqnUnYrXW3zcorjYvsLi/FDJ5xu9GAGxXb ZJ+w== X-Gm-Message-State: AKwxytet0IgNagevrGQrnawgamphzVgVf9WtSazzcO+8VjMzcZk6IKY6 lTbZKq52HNTlYWSFmRSkhixkuQ== X-Received: by 10.98.170.24 with SMTP id e24mr18421870pff.177.1516953367659; Thu, 25 Jan 2018 23:56:07 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:3967:a579:e81d:66fa]) by smtp.gmail.com with ESMTPSA id h74sm20415301pfh.28.2018.01.25.23.56.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 23:56:07 -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] atm: firestream: Replace GFP_ATOMIC with GFP_KERNEL in fs_send Date: Fri, 26 Jan 2018 16:00:27 +0800 Message-Id: <1516953627-30983-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 fs_send() here, my tool finds that fs_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 fs_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/firestream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index d97c056..cce6f9f 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1184,7 +1184,7 @@ static int fs_send (struct atm_vcc *atm_vcc, struct sk_buff *skb) vcc->last_skb = skb; - td = kmalloc (sizeof (struct FS_BPENTRY), GFP_ATOMIC); + td = kmalloc (sizeof (struct FS_BPENTRY), GFP_KERNEL); fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%zd)\n", td, sizeof (struct FS_BPENTRY)); if (!td) { /* Oops out of mem */ -- 1.7.9.5