Received: by 10.223.176.46 with SMTP id f43csp79460wra; Thu, 25 Jan 2018 17:52:07 -0800 (PST) X-Google-Smtp-Source: AH8x224///htEfay4m3VKuTErnhGVXZDfUrfCYGcLgOdhhAy4pERnfutK0Q5wK/UYsd+RCpeeuDY X-Received: by 2002:a17:902:6b48:: with SMTP id g8-v6mr3875130plt.151.1516931527336; Thu, 25 Jan 2018 17:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516931527; cv=none; d=google.com; s=arc-20160816; b=KM09hefkfnPMInOV8z2TgjnBi7UFutGsIq5/xDvKRo0N88B5J418+EoDju0wWer/I2 JjNtgLeN2tNxhSoLklNEm/bfhotgHFTBw1WmWejVaFJvlCqOvf+aHtS8v/rWwmQAB8tv OQ9tKGORgUtg1hYHsTGlOTdQoMdFLOi4sm9xJFOlLkig1L7IzOxnlmSk4l+P5gl+sEL3 KHgU3wcrFUbW0lvzA89MKX8TIKkbk9CI32TPLCVYxbjDDmeo0W32Un29H3wDLMnY+H5P cSyHjGGdgu55frrqvXU1WiSr7ZHeJVSkYdr4zHbg2u1D9HMWINzCUDqkXQIo/Pq80Lo5 GLIQ== 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=GiQsDlrRlwswjf9v6SYKuUh4+EBIqzbsaxj5H2slHHM=; b=GK+7GdMjaTZXXq9ksZFeyiks8YCKDn9+RCqhZy+yPQY6Vkcq/Gk0isTNygLXpZerMS AFk4zAwmLbqC1Yh7RMvbPUdxsWGzfC6Tr/qxajQGVAvf2SuhMIk0kNWJrd+dM9XiGo/6 emtH5zbslQhEuU42MUbwHkgg1KAY5Ki19UFLy8RFTau0qvv1mfcjnsOw7HlIBJlVpf+a eflHgasa5+blFtdmeAJGbKQC/jZPo8hAVastVrDd+EmMpU6yFCjQ53VUnoVOn9dOgyUC mssn5/RtbTmmdziOpJZRTD49DmF8Bc1A4LmdLLGTUvbeeCap9j44zQrawz0xGxUMIZAv 6BCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sO1l8Y2a; 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 b126si2305352pgc.610.2018.01.25.17.51.52; Thu, 25 Jan 2018 17:52:07 -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=sO1l8Y2a; 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 S1751590AbeAZBv2 (ORCPT + 99 others); Thu, 25 Jan 2018 20:51:28 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33401 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeAZBv1 (ORCPT ); Thu, 25 Jan 2018 20:51:27 -0500 Received: by mail-pg0-f68.google.com with SMTP id u1so6279037pgr.0; Thu, 25 Jan 2018 17:51:27 -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=GiQsDlrRlwswjf9v6SYKuUh4+EBIqzbsaxj5H2slHHM=; b=sO1l8Y2aYIUQNX+CFEB+jHG/HCc0gXWllFwIHGk5abM7lwRA/re2cIjdW4zny7dYef 99hO+HsCxzfliB7v/qIHgLX0qmg0IBzeHNUq52DZsqplu168qhrm/NXydF3lsTbKKpEc /JCc2+XphXjELsPvMdkrX6yR6V/7AvyujUF63sxJSTlexccnArIczd4gWN4sJa2pTrfI p1BZ8uLPevOCNawNziB83SbMOCJOqud8MxgHbUU9P51wP4Ok/v6IQ17CKrnOdKQKGoTJ HS1A3C8IZFtBMElxhVDbC+CqmYPjZ1x1AKhI45va6lbynx4HHUmkIcFPs/4f2B+NoB4q C8KA== 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=GiQsDlrRlwswjf9v6SYKuUh4+EBIqzbsaxj5H2slHHM=; b=mtxIXpFxCX6+HeeoJcifiMahvBkzfaG4VxvsCZ9iLxM43hCup0yCAKdrSRNPdUoc5P f7UFY2QnHSO3CHF8vSx7ZMg+mOScrUYD7ZHUThZyDQjMbwcDZ5N+6AKekUuUxaBkybdF YH0flrJx/jr0PpVbItKCVDvmjpoyKsBolJvAQViaVf11dYC89JxFsQa9khRa7Zjw7b0q MMk9dOObn5F45atnv9qINfBlzkzV6EPjBjOtousI/UWzj00MECLLx51CCKc7t0MBRwkF Sl04cBz88lwviHHQbiqsOZVCygBoYBeDV8uff9dpqA9V4HEEUOfSysdd7JlQr2GwSWDE cyqg== X-Gm-Message-State: AKwxyteLnAwfgNCm239ixVAzFIcNWD053M2ADGwXFKiEPvWtMSuw1ra8 2ArWnbxWvlnKfLv0yoRDv+s= X-Received: by 10.99.95.20 with SMTP id t20mr3799354pgb.79.1516931486604; Thu, 25 Jan 2018 17:51:26 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id m67sm15669653pfi.157.2018.01.25.17.51.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 17:51:26 -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 1/2] atm: fore200e: Replace GFP_ATOMIC with GFP_KERNEL in fore200e_open Date: Fri, 26 Jan 2018 09:55:59 +0800 Message-Id: <1516931759-25178-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_open here, my tool finds that fore200e_open is never called in atomic context. And fore200e_open calls mutex_lock which can sleep later, thus it is supposed fore200e_open 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..bdffb85 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -1422,7 +1422,7 @@ int bsq_audit(int where, struct host_bsq* bsq, int scheme, int magn) spin_unlock_irqrestore(&fore200e->q_lock, flags); - fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); + fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_KERNEL); if (fore200e_vcc == NULL) { vc_map->vcc = NULL; return -ENOMEM; -- 1.7.9.5