Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp308140imm; Thu, 26 Jul 2018 19:46:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdltuiuBMvCsXgLyzmP4w6Dl1nqb2ouPIIW3pTHxv/OUjUIwl0Mtq3Hs6DpTGaESc9TBmlJ X-Received: by 2002:a63:7a0a:: with SMTP id v10-v6mr4184198pgc.444.1532659603704; Thu, 26 Jul 2018 19:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532659603; cv=none; d=google.com; s=arc-20160816; b=ZKh0uYeszQ4Q4NFZEV7YUAzA/vCo0BvEIe6fKR12zO2X2e/R9hSvx4h2vsQXYZ/sy0 s0T2oefe1ciI3mJuuZi/leWN70351FI+cdOleDSMZLkvCq1Hy/2ZWD9FNOaD5xKNrkyC Qsl4B7UKgUPr20u0AGOmnG1TCXArLnSQQsSenjAcJuoW08LyWK4QyGTxMbfA2PKBUCAQ rYpkwsPZzUHHpOajzNUBFeVcHZfUHQEmsoGRTchZ1bTjs2+ry8bAVe/Q6G78Ub/Iw/ja qLXtHSv1obbmz+ISF89v195r2QXiGybsl+ycFfvoFVEs69tEz2sr9YOP5CAoTJqA5xVw z86A== 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=RMYnp9oteqapWB1Tgj+wT9vMRQaECIr4N8ZuYxkVN04=; b=yen1bZ+xxZY/OPYtaSkidZb4yJ7GV+Y4UIarL7Bs5XSsoTBxHdIwBigFWhTofhG3ZJ lcze1/IrX7tuEPRjM0hHhtvY7s4QghnYKFLKJCjk0wr8+XPBa1RAx+oEJi2nRWEQq2uD DjhAOig3ipprPkHKvVmkBCmtFo5sGJuTSN9NxrGlXFmnEtl2oPXyqUyc406sPHUvQ3B4 S1HAXrPpCmD+VLH2u1hRMWN6FSoCDV8XhHCfHDXB/37hZK6U/T0VgmDdF0OWqlYH1rmS oNFIPkezaFiu0Y/OPxZypbhcCpERhTndGZYnmoKyk4ioWuUoMEFQktlwaU00PlTvvclM iSLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fuOtFtLK; 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=QUARANTINE 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 d1-v6si2555635pla.9.2018.07.26.19.46.28; Thu, 26 Jul 2018 19:46:43 -0700 (PDT) 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=fuOtFtLK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726136AbeG0EFQ (ORCPT + 99 others); Fri, 27 Jul 2018 00:05:16 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40294 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbeG0EFQ (ORCPT ); Fri, 27 Jul 2018 00:05:16 -0400 Received: by mail-pg1-f195.google.com with SMTP id x5-v6so2321209pgp.7; Thu, 26 Jul 2018 19:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RMYnp9oteqapWB1Tgj+wT9vMRQaECIr4N8ZuYxkVN04=; b=fuOtFtLKGd9yUD6hwXKwV3iQEYqyAkdScubYeqWSgD54izDBSr1cGqecvpeCBOtRD3 X6biAgy0NLFUXElzM2TD/JL8ZF42zyniKe7IlUJFx+6Hga2Z4JZYaQwp/qtWvkIltO4e Px4ZP48BVZ6svz3Uuwzj5ees559YdOuIq0JHKdcgsh2HZQmQg5IctC+wi7FhTBDWPCew wlHuC2afpHe0j49DalPLxj0Bw1y7cGl7cClBFb0pAVD6w+D0Y1UZAQMK2B+Tm9kp9vBA tW5UBwbsjKheYgCkudxskxzoACtptQMem8/BvyJ/2nrIkLmgPk9acWfQr0WQoQ2oLf5p KcIQ== 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=RMYnp9oteqapWB1Tgj+wT9vMRQaECIr4N8ZuYxkVN04=; b=CV6GSzGus5ESaKBfDBCuMtMQF+/YBSpOxLbTckxhqX43V0h5Aop7wOI5rWk1Xspa6p BUpY+PyyyvU2vB1/JOpMy2iUrJb/pd7l3DerVyLAVcK6gxrZ2DZtpsxu1/qlOBZmFfU+ LlP/Z2fwFCUsjKagluMKINa0KnZZDq8k+6KYqZTFJxkyQQL4RrXATjLV0f/50O/I0Ntd XfwghQv4DZ6GRCw0ApH+xpdq7/jRkJzT/BxLS1bpZW8Kc3LCnQh5dVDniPp1uwMzmcLw sWp7HTyFM1X/hPQ+Iqu7q5kCT2kI/NcV8LYFGPyu3wL2r8MaSQ8ouWcZq/zC3k8qZ8Qa BCxA== X-Gm-Message-State: AOUpUlGiaelyI5rOmgUIkEnamH/dtyDduGP0vKUo5rRFcQn889ezht7I Ef8APDuYRss9kNvZXrSbxsg= X-Received: by 2002:a65:5cc5:: with SMTP id b5-v6mr4198138pgt.425.1532659537835; Thu, 26 Jul 2018 19:45:37 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id z20-v6sm6369814pfd.99.2018.07.26.19.45.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:45:37 -0700 (PDT) From: Jia-Ju Bai To: isdn@linux-pingi.de Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] isdn: hisax: callc: Replace GFP_ATOMIC with GFP_KERNEL in init_PStack() Date: Fri, 27 Jul 2018 10:45:30 +0800 Message-Id: <20180727024530.1849-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org init_PStack() is never called in atomic context. It calls kmalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC 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/isdn/hisax/callc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index ddec47a911a0..0faecb723f13 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -1012,7 +1012,7 @@ dummy_pstack(struct PStack *st, int pr, void *arg) { static int init_PStack(struct PStack **stp) { - *stp = kmalloc(sizeof(struct PStack), GFP_ATOMIC); + *stp = kmalloc(sizeof(struct PStack), GFP_KERNEL); if (!*stp) return -ENOMEM; (*stp)->next = NULL; -- 2.17.0