Received: by 10.223.176.46 with SMTP id f43csp176181wra; Thu, 25 Jan 2018 19:49:05 -0800 (PST) X-Google-Smtp-Source: AH8x227ADSzt0tTgY/dfB88A2eT1OaKmF/slkU0X6mZrOXfI+93696bzeUK4kkf1Xl0jedkZpF/m X-Received: by 2002:a17:902:203:: with SMTP id 3-v6mr13758195plc.413.1516938544943; Thu, 25 Jan 2018 19:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516938544; cv=none; d=google.com; s=arc-20160816; b=qdXbuHE6NJ7yZCEKx4ajogJfYybHJuLEHjyamJsFX7YUTHm6eOXc82nZ+bztn7nUZh mJJTfQHnCPVuzijNofLls8GQO7InzEsb1J/wFDtqUEz6DHIyOjPO5V7FMkmg1e+Utaqg IQV/zglj4NBzy1Wqfuh0CWtJ6GeNPlYpsuozj4tbSs43MV5qRWQC/I3v4daxFZdqnzCZ jmq3zovsmVWeoVMIy9AxMJmDPri3Yd35RqoutWZ9syjtKDoAn/CvmBIT5szYiM+DkJMB 2wgxBjmwPWJwZOYb5cFrrq3K/2rWUnY7Mz2CCCsMdaQtAONZVNuq+0+IYQXrtihxZk5o MjqA== 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=OSalXtb6pfqJQ8ZLwYZepRgS39yAyQLJ0wkfp84MbXU=; b=Wwoaqr+y3/DF18fAA9AcN7iLPiLccxlfSIbTR4878V1pftYG8SOer7WlVvQjlCz1jc ujpkqlyCHw5o5EYp5kQQfe4Ay7LUpuaYNH2jnQAhKrXe6yyJHfqHqJ6ndgTShkpT1aPE iTNdfX80tJpR0TI5dWS4piodSJbl4QrtENKvl1WlurGiNVwgNeK9tDp/KD2qPV8feYr9 0Z13Gv2TFn7KHWiIz9XEKCxWUmqXkHQ6ey0/2znVK7p5eMzeVeyA6rWoz6gcA6jBouSv 9w1a2F97sDep66mMPd/owdygnfOIo7CvN/LrJj8/8PIn/X3exoOF+29uqcQeZLe1pVF/ nI2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F8qrJISx; 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 v14si2447791pgq.604.2018.01.25.19.48.50; Thu, 25 Jan 2018 19:49:04 -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=F8qrJISx; 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 S1751562AbeAZDs0 (ORCPT + 99 others); Thu, 25 Jan 2018 22:48:26 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36686 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeAZDsZ (ORCPT ); Thu, 25 Jan 2018 22:48:25 -0500 Received: by mail-pg0-f67.google.com with SMTP id k68so6452173pga.3; Thu, 25 Jan 2018 19:48:25 -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=OSalXtb6pfqJQ8ZLwYZepRgS39yAyQLJ0wkfp84MbXU=; b=F8qrJISxqP2Hqja2EaukTb+oNFNZ8XlULXbVW44n/TeXGGFSV/OBHcvI5wA+vYhRWh mDIu+/S/x1GGFLlkAZ0etoffVg/LY5AM5X3THbJvz9QfaF6Imclp6AK1UrFOM1AWXChU cnPTBpAeF5f6iiuFicdetbkPPBPcX5VW8JLJMxWVReDIhUYsRLRtcv/yUwEb29zlJnZ3 5z7i3yasrhfwSIvyRr469iPCGcxRfdV7LCLwYFAKmLH/8xQwIUdvas1w1nP82YibOMMd /g+kbHybiCA8x5O2Xi7Wyr9UximIPuz3bdQUqZXwL0ioGMImkhh7JhLVd6VesJj4vEcU CBYQ== 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=OSalXtb6pfqJQ8ZLwYZepRgS39yAyQLJ0wkfp84MbXU=; b=Abw+QrqAAY04nYZRaf2+sddsGaUIBXlq6LpGQM3vQ/b7M6P64Q8OySDjFYAQVBQVPx kKVXM5isS2yMpTWtaqRZDl/uDay+Qgiu8QIuKEANvMoiT+lvLnLMjJxd2mBdFnVPb+od SekVGF4Oz4Ww/3B5dS9HJ6P/CkbhnjkYY2LuR6WXunTNc842TvpW4icMJcJ6ucPLuQQM 8hRC4Y8u/EOIU8hM3KencvvJ1gOeJPtu4l0CevTGCW3UJPD2BN1cou4BjuWfEAogQXcj Ya1+zQ48Oqr93PAnJ6FVkLnlYQuMVw9r9M6+V7cuJEMbicaDTDcXhpioa4S1NFtg2WPF 0UGg== X-Gm-Message-State: AKwxyteTgdioky4gs/d4s8hRLKG+yUQo55gLNrta3Nz93Kf/P6yzan7G dHnT+POikiuChFDZJVh2t04= X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr13031433plj.411.1516938504738; Thu, 25 Jan 2018 19:48:24 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id i192sm6078145pgc.8.2018.01.25.19.48.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 19:48:24 -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: atmtcp: Replace GFP_ATOMIC with GFP_KERNEL in atmtcp_v_send Date: Fri, 26 Jan 2018 11:52:59 +0800 Message-Id: <1516938779-27562-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 atmtcp_v_send() here, my tool finds that atmtcp_v_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 atmtcp_v_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/atmtcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index afebeb1c..f7a27ed 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c @@ -210,7 +210,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) return -ENOLINK; } size = skb->len+sizeof(struct atmtcp_hdr); - new_skb = atm_alloc_charge(out_vcc,size,GFP_ATOMIC); + new_skb = atm_alloc_charge(out_vcc,size,GFP_KERNEL); if (!new_skb) { if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); -- 1.7.9.5