Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp587232imm; Fri, 27 Jul 2018 02:29:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2/CleifJ8RiA1t4poXbVVCD+XCZoMGF8h8z7fk3O+6cVGuZWQyqWVcFECD296cqww3KsG X-Received: by 2002:a63:2644:: with SMTP id m65-v6mr5277298pgm.371.1532683774907; Fri, 27 Jul 2018 02:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532683774; cv=none; d=google.com; s=arc-20160816; b=KfkaLN8xWcUr9kNa3ZnCGj45Lh1MWRbCVsX5dly4nyDc2wWj9xaSflMezGBn33KJRA tnEZ98r9ER3PHy2ModjD50nVly54DBBG9+Xp/Q9CnOLtuYtDKUhXFd6/4HrMeSabkx37 vNz/BAovBOYZNzGFiLXrYNUL1kamLq9PLxqWz9AHxhTqYT6qH4L35LxZueRUyQvgeTlW pLEDuUaAt/+UwclYLS+j1UQv5oa4UA1brU03mXa77Q23VqEkqhitjzKOqXZkr38g4clO EMQ9atSHbtDl7xSlWtpocVjWarUGKFBMUmZqOBCntD7IxpU7K/oX4WEy9eF0q+6MnLn4 v9CA== 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=JQYFqhmvm9oimqODcCnHpXglZUI39aOOaIg2pJoT+p4=; b=EDyaVrlD6WuygynZSfH6iyGszmMMSp0wnsHrzcdt2Pt9pBQWo6eMa6UZNShTt71Lxh WjqC0DT3g6UGu4cFdJKvnHMKp3X3ULh0n8Xhl9Z2qesZBgCfASB1fSX0771aMmtZ3Cn9 cMj1AJI2+Wh+xqGW/FAb2SgHEeDqhFk53UFEEOyduzkHefPZ0x5o4DIzhcHmAn86oYMM uX+zRq4zytSehRhTc+XWgtEQG7kIna5nLl1RYOnbJTQhvsQIY5ZkQ13DyEnqwL1OVOqI AuzMgnuTF/1QLxm2NkJaW5q11UWJIrvIDskWDhbrc+Qtd0qB8Dl+exAQBnLEF6PYHY1a nwbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uw0YtFNB; 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 d9-v6si3350676pgg.423.2018.07.27.02.29.20; Fri, 27 Jul 2018 02:29:34 -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=uw0YtFNB; 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 S1730318AbeG0Kte (ORCPT + 99 others); Fri, 27 Jul 2018 06:49:34 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37605 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeG0Ktd (ORCPT ); Fri, 27 Jul 2018 06:49:33 -0400 Received: by mail-pf1-f196.google.com with SMTP id a26-v6so1550107pfo.4; Fri, 27 Jul 2018 02:28:32 -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=JQYFqhmvm9oimqODcCnHpXglZUI39aOOaIg2pJoT+p4=; b=uw0YtFNBothlTevafQgLVK2GgNyTq/JlG3SGAlwDuoMZCEbZVuEvQxQmiXuBsSrJce dYxTYN3nhUJLjmlsSkjClsCOnM3xdSSSOYDbO+lWgKZhRv39PSwVJQlVb6y9PHHXBN+a TIuPg3gAlDWpDUSctGwdzaJBHaokykr6ZXD+bo1NXSd6bJF9k7xBd7qyzg1Ci13M+C6R tUF1mkmuxj0reyE58pg/ff3ZnElANKJ1wqSEQYPMJNr6/a7TYCL8vKHEsCHmqHp8IsqP KWKNMkl9TkYca8M0gF8V0RfO9s5UsNF76V6E22+/ZhEN/R0VBcBuFjdMKBjuDzF/WU29 cymg== 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=JQYFqhmvm9oimqODcCnHpXglZUI39aOOaIg2pJoT+p4=; b=uUdtxaG5La/RbpXuAV1m7iScZo5RxBcpP4z469SgjIR/tS4MxEEQvusqfuEznZfuF2 wUTK1wL+UrUXv8zpeRD6lQyO5DEv9HrcQAsLp4zJu/za5vN1zZYhZMBOq3iNWWf5g2UB ImzYQdJPMn6HI5AQm/90qk+twOA5TDkPO71njg0dGjoaZRfpZ72mnl8g89JgTumGne4q VgR2k3/AwikKgbo+i9gnIkLzjaW2AYQruk+gatfpDgy/vOuovYsYhPyzvxpZypt8ozyh VuSERWcUScTt2aWz33qVNaKMB1iRMt3dilpMIEX4y8ECA/UELgUr1cazmJvxx4mqfpui 80eA== X-Gm-Message-State: AOUpUlGtb/eoizmP5QJgH7Gd2oZ5c4c6EPVDB4W9CBR+XzPYiFoSqrbl WefOVpZmAxXeuHap6yVQga4= X-Received: by 2002:a62:998:: with SMTP id 24-v6mr5739379pfj.99.1532683712510; Fri, 27 Jul 2018 02:28:32 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id q140-v6sm6378886pgq.11.2018.07.27.02.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 02:28:32 -0700 (PDT) From: Jia-Ju Bai To: jon.maloy@ericsson.com, ying.xue@windriver.com, davem@davemloft.net Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: tipc: name_table: Replace GFP_ATOMIC with GFP_KERNEL in tipc_nametbl_init() Date: Fri, 27 Jul 2018 17:28:25 +0800 Message-Id: <20180727092825.7370-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 tipc_nametbl_init() is never called in atomic context. It calls 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 --- net/tipc/name_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index dd1c4fa2eb78..960aa21444cf 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -731,7 +731,7 @@ int tipc_nametbl_init(struct net *net) struct name_table *nt; int i; - nt = kzalloc(sizeof(*nt), GFP_ATOMIC); + nt = kzalloc(sizeof(*nt), GFP_KERNEL); if (!nt) return -ENOMEM; -- 2.17.0