Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp309878imm; Thu, 26 Jul 2018 19:49:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfVBfoVs0AgO8+hRyXYSqk2fFUQx1Q8dGRRObQE7GOavxoEfu0l8fYUg1hdWto5mSNJ3VtE X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr4268159pli.219.1532659780000; Thu, 26 Jul 2018 19:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532659779; cv=none; d=google.com; s=arc-20160816; b=JQuVJmQfj5+E6dOnVNoGEDyAAlNIwlRWoFrf1rKdFCshY6GGU1/rPzhfH/C/MnUIZq dRP1rgdZMqi+/Jj+gOkPPhdJ6A/+MIDqozGBMRC0BaNJgiSES72+hw72eqKoOnQJBElR 9wGUHCAvphqExgFiCBBF8+DtfwjWImn0ad1KxRz7bVICU85x45f9geX9wqm/vOVJwZXo tnkc5Q8yDC61zmOIJXRrGch4rbiNNi6ZkUyNMRN6VoVXboD9+IC1UejwOyGibS9APV4G CIIt2SsWud4vit2LuxZqTvJuDALfB9Xo8R5dF7nGtsfFKCDqPH6KtQWbWiy3k37Rmcfo Y+jg== 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=8yjXE90/Gx9a7TUfxETbMTVN33860hpUiZYcT6PKR3A=; b=KfjCI/WKmOr4OC8VZB2PoQ9jMugRcCqVRrZdmPunNtFCBzY92Csdh39XlZCx4XdqAT dYEgkP98Ka+oc55jCjPen5oaCSDubqnWYHCpT+HMtrLWjeCq/ATkIxTzZHLvn87GEfPM Wy6vd+Xp5Yy1qRrIEsVggfO2KlZjrPaVYlMmv4A5kgpqbo33bNtMgCtaq/D7HWHhXK9U VQ8qA0QRtygKTK9trFUhjd7mtSo/z2HHNxL5c8AI3MvTuLCQPHV0sY/QU/UlZVuxbdXA kDYXRMYpv+Tw7fL0XwYlItYOo7P0JUWTLWRQ4kqDZJ4jLdDTJ8Vy2fDaBSGGXrRy6+ak emuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQlcjmoz; 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 n1-v6si2527674pld.429.2018.07.26.19.49.24; Thu, 26 Jul 2018 19:49:39 -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=YQlcjmoz; 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 S1726053AbeG0EIO (ORCPT + 99 others); Fri, 27 Jul 2018 00:08:14 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43950 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbeG0EIO (ORCPT ); Fri, 27 Jul 2018 00:08:14 -0400 Received: by mail-pg1-f193.google.com with SMTP id v13-v6so2321479pgr.10; Thu, 26 Jul 2018 19:48:35 -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=8yjXE90/Gx9a7TUfxETbMTVN33860hpUiZYcT6PKR3A=; b=YQlcjmozl5eW0eIw4m+yX9OocETDB1NWITWm9AeD086MNYGUQKlMLRaleUUEbunVjj +c5Y1MzKA9ho6JqOI0S+JTE0fjf6NxyECZ0o1QAfkIb49j6T78FY+i/cserxsyaFOctD MYaTR0mJ6Mud0d1uBLreeA3HqPKbgeQo2VZ1x024d+kb9wJPgylwH0L/cZlouZsx7x69 SuL2IWv8jhsA5TR3AEaY7l652/+VE9Ukj4veKfPMGohPFEX7ZZHW8nA9rWAnr3NN83zf iRg3+xpFd5Ix++Er/f33rGxnAYfd+loZ1WvDH0YIi8w04QrDorKYnGvRHSAh+KIvOBxG 6fKg== 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=8yjXE90/Gx9a7TUfxETbMTVN33860hpUiZYcT6PKR3A=; b=RPZk0Rv5eqvjnJV+3HhMfFRpQ/HWdrF/AanA5ht6nWWZP7XB2tR/TCW2kwxJ2UkF7G LQq7UZRVR8qAJUc7/AG7m76j8kYzWfS1SHIaQpC+PJZIC7+yZrkyBLLZqfts+lnKaw/B nQdAkAz64vkyHSIf+PI3tPZX3yrJ56lTaHuUSsUudrq0bX4vwVVbElnCNciofmshZAv0 991R1AfnRIpQS5mvSuCsOLC5tEMYrp2V4ivjxv53Rxbwh6M04ZLtpaWTf4taJrWNnDYu 0HVoyqeWGE7tEdxXXQ/aNiSp+oNg2A+OQMRZPZY6z5fUNPBVKH5s0u0O5nTjMPQg1LoY su4Q== X-Gm-Message-State: AOUpUlH4xDNsRVJIqXCkMVjYhD+lbQjt8b8GoGCft2X5yPeHHUj5HdWk vBsor4w70dog5vYVkK9FdEY= X-Received: by 2002:a63:ce12:: with SMTP id y18-v6mr4294920pgf.144.1532659714879; Thu, 26 Jul 2018 19:48:34 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id g85-v6sm5831264pfk.39.2018.07.26.19.48.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:48:34 -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: config: Replace GFP_ATOMIC with GFP_KERNEL Date: Fri, 27 Jul 2018 10:48:28 +0800 Message-Id: <20180727024828.2107-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 hisax_cs_new() and hisax_cs_setup() are never called in atomic context. They call kmalloc() and kzalloc() 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/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 7108bdb8742e..b14714004503 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -1029,7 +1029,7 @@ static int hisax_cs_new(int cardnr, char *id, struct IsdnCard *card, *cs_out = NULL; - cs = kzalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); + cs = kzalloc(sizeof(struct IsdnCardState), GFP_KERNEL); if (!cs) { printk(KERN_WARNING "HiSax: No memory for IsdnCardState(card %d)\n", @@ -1059,12 +1059,12 @@ static int hisax_cs_new(int cardnr, char *id, struct IsdnCard *card, "HiSax: Card Type %d out of range\n", card->typ); goto outf_cs; } - if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) { + if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_KERNEL))) { printk(KERN_WARNING "HiSax: No memory for dlog(card %d)\n", cardnr + 1); goto outf_cs; } - if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) { + if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_KERNEL))) { printk(KERN_WARNING "HiSax: No memory for status_buf(card %d)\n", cardnr + 1); @@ -1123,7 +1123,7 @@ static int hisax_cs_setup(int cardnr, struct IsdnCard *card, { int ret; - if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) { + if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_KERNEL))) { printk(KERN_WARNING "HiSax: No memory for isac rcvbuf\n"); ll_unload(cs); goto outf_cs; -- 2.17.0