Received: by 10.223.176.46 with SMTP id f43csp173749wra; Thu, 25 Jan 2018 19:45:45 -0800 (PST) X-Google-Smtp-Source: AH8x224Wru74wLXmGp0lego4sUcSFKRZujbchlyNhUH8YKvjR3Q6i9LKICamr6vNyFLdtVZrYYTn X-Received: by 2002:a17:902:10b:: with SMTP id 11-v6mr13645082plb.336.1516938345715; Thu, 25 Jan 2018 19:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516938345; cv=none; d=google.com; s=arc-20160816; b=eM2T28Qx8Oc9WxhOQVXLmjmLfx4QcBYPM2wlTi+F+itXLvyVeQ0Q8BrcF3TsJ74pNB OPo1QrkDgTEx9JJ+xxqXPG7wfiyxXqs8RX7iAh2flNtO1CY84YdH6GesF2BC1Jfk3ILT nRRbhsP3YK/ifRJMuAMdwcmHd/2JbB/z4zfumgSnPic/wOPqplsrCJa4aeLHjUnnwrA2 FnILIBvARz9/+t1lpppwzLZyJHsIuQaoM30ivoFQthCTUT6Aa45Yds2ejHwJgXR70OB0 jSpEpLUI4qImjb1jdxth0ZGEbQDUYSCYGS7FRtIWDLI20rtWoavDgtJbEZas0LxRofLT m9ww== 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=X6SZr0IIPguxtFbEjUFmOn5G36WhMpUmEeq0mtJi8Nk=; b=Hg9lF4Hi3icCryeI/S7aLsXKUo5/NPqVwGSs6iHWpL7OVc+zrRX0q763+wEOpH9N7B Ph8KuSSftPySMAXL0c3Am3eD3qO2z3bDkj2UAg2vjL3sBO0znBZ+sBBmlO59QzlIwVsK 5KEk+1IH0UkGhSa9jGdn3jFbN9FNi4IgfnCWr8GZRwhoNpgPYVwc0sHL2hsNs5VilAq0 jF6Ua5L7DzIhD/rW+7DePlTJSbyWuWcwEG5n0/+WI6Eonq3X9Jw7LUjGQy4ejQi83Fqt XvXm0FPMR1Oo8x1Z9VuAo2MR4OUpCn8vPzrFbLCfQE8dLIjhnvr5N83d2EmXlxjHlFab u6UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hJxtF0T/; 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 z2si2419696pgu.804.2018.01.25.19.45.31; Thu, 25 Jan 2018 19:45:45 -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=hJxtF0T/; 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 S1751604AbeAZDo6 (ORCPT + 99 others); Thu, 25 Jan 2018 22:44:58 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35788 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbeAZDo5 (ORCPT ); Thu, 25 Jan 2018 22:44:57 -0500 Received: by mail-pg0-f67.google.com with SMTP id o13so6446838pgs.2; Thu, 25 Jan 2018 19:44:56 -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=X6SZr0IIPguxtFbEjUFmOn5G36WhMpUmEeq0mtJi8Nk=; b=hJxtF0T/B8hBNZaFYPNGUrl7mlisQt9gw4fhKR6jm4L0fKGPwGA9WG6+FBEK5osSuE MfUQeMin5KulMJGUj7vulGHOUWg72aZjjE7Q/nxpDpXZrSxuoLW2U23+ecoVA6NBh0ah bf3DAUAZ04da9mY6nsSc9OpT9PW3vPDJ3Q4SXijqk0U9i9l0uHFSnCtsCGj/B8vfwVnQ p12acNhGzlfCTFa9IuHhQN9F/YKJSlcErQpswNrQLE+PweWCmbvMalN8B5tNOzh2arL9 RxEs5+6IamARphgnkliO/kSTcCZ49m3+MFAu3NG66jttLVZIprU/JHEhVcpAd+ybFjLQ G1cQ== 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=X6SZr0IIPguxtFbEjUFmOn5G36WhMpUmEeq0mtJi8Nk=; b=t0bNgFC85NfbFzk1yJcNZRhKu6/I47EuPG2Xo1hoGmPTuD8Fiok8yVCWMEo1oWWu59 y3rj0KWiJ43COt1HTLWRWjfLcfKowAAorT5tR3OSP0EhwpM05kZRAxU5ykNtic7JQFqu 0Us5nHk42Ulm0rDEXH+ZMClA74fLnKBtj09Bj/hMB+2YshzNG4ku3sNNey/UUKCNPYbO nAGSD5FFSpLcL3Cz3+F7RfVURyjFLykp8iDyiVh7IoeeY8UIR9gxpmdsh7d85mw91gt3 8ApzGj1EC3d7V4oXcy2nXj2t3i5+E/WLOv+SI5pkVBueX+JWlwlzG3aEOt2S9B/rhGr0 i8Qg== X-Gm-Message-State: AKwxytcGhW6IYnqcF3hn2Qh46Cg2vsqC/pZVRBWaPFAKxS8iSGS5vdrR K+95chOLkWL5jbgnerEtiaw= X-Received: by 10.98.89.198 with SMTP id k67mr18005052pfj.110.1516938296540; Thu, 25 Jan 2018 19:44:56 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id c72sm15330375pfe.26.2018.01.25.19.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 19:44:56 -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: solos-pci: Replace GFP_ATOMIC with GFP_KERNEL in psend Date: Fri, 26 Jan 2018 11:49:30 +0800 Message-Id: <1516938570-27453-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 psend() here, my tool finds that psend() 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 psend() 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/solos-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 0df1a1c..ac10b62 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -1166,7 +1166,7 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb) if (skb_headroom(skb) < sizeof(*header)) expand_by = sizeof(*header) - skb_headroom(skb); - ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC); + ret = pskb_expand_head(skb, expand_by, 0, GFP_KERNEL); if (ret) { dev_warn(&card->dev->dev, "pskb_expand_head failed.\n"); solos_pop(vcc, skb); -- 1.7.9.5