Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp589882imm; Fri, 27 Jul 2018 02:32:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfyXFcUXgusP/KQQQiONvA3Mm6V/47ik/S3MGikFg2azGQPoZY5laEBBm6JL1AXyky2MOQ9 X-Received: by 2002:a63:920c:: with SMTP id o12-v6mr5397673pgd.141.1532683968209; Fri, 27 Jul 2018 02:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532683968; cv=none; d=google.com; s=arc-20160816; b=zh8li3Zdfh6Hy9PlayPw2azDPi9cDE64qVFNY2zV7bsKp2h2zwBk/a+yvCVcGMmIQj t7wMZS0/nIwecV08/uHLJKKTLfcuRxm6kjUXsO84Eten4hQC/oW0OkGBCusJVMXZkLla a9PaVMG8vK7X5/7eq9fsrferv92zSHFv6T8L6SQa+4P1JUrht9nSUp9TihTxHqwSJ9Tz fWsWwR71MpimLEkV0Nd1hvaY9zILPhk+tNyoYRfjn3/hPSpcQAF7AShu0IfTvgTxqWlF gM8LiLsfCM0a5eNRsQgPMGF8uLmTcFr/b57AZSoVP8HNaxGMhoPu2CriS19XJ6Ke8Uqu 3aEw== 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=U2bUIY3jlZNqRQT7LBCuDAObxV24OjoUZQ6VoM6FH/M=; b=cHjDyRl/cGwXmvBrnEUVDKj0en2h/dCG0aBRz77v8LyQCSVrTVj/cLZCIAIHKdYXHl HZvT0pxqNh+2/7VOM6M2qlnoPsbSDB1mC1WVhWj6JruXlHIs5tB2VCN1p8xDJvUJCYil bo3gTHvjppngvBZEUBK4U1PVhIuMekZpreuvnUHq0iH9UmrrPl9Fk/MtIYPq+CtUFzlI Wa/WEpE4tWVDV4L3T5baVi3fWSoJGKK2S0ZkV6cyjetrXKA/L7H8KIisf4Q+iVoT0Ngq ObmL7poUyD3cvxfq9C5Q9XQ6PQfHW+Ub9Fvp5XU6tF99r4jhlbFLXwWs3U6OYSBh0eAm pXXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TUbKMExv; 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 s10-v6si3095828pgv.47.2018.07.27.02.32.33; Fri, 27 Jul 2018 02:32:48 -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=TUbKMExv; 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 S1730425AbeG0Kwp (ORCPT + 99 others); Fri, 27 Jul 2018 06:52:45 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:37579 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeG0Kwp (ORCPT ); Fri, 27 Jul 2018 06:52:45 -0400 Received: by mail-pl0-f67.google.com with SMTP id 31-v6so2088563plc.4; Fri, 27 Jul 2018 02:31:43 -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=U2bUIY3jlZNqRQT7LBCuDAObxV24OjoUZQ6VoM6FH/M=; b=TUbKMExvB3PzUOI4/JEYUW9LtrXSDaxJ34XGmxBEsL3L+NSDwChs4m4gRh8yT4qG9s EwNvpJLXpdtlQGHzaGc3dd8+lnekXBPUSHApFcqWa0VM9TpQIJPKdfkDmL+p+i+qYE9B e6oA0ga7SOB8qZ8MRdfrGJvJAhUD7t1+N7MlYjJDvHFRqObKOhQPgvyV9hmBXzjYGuDw /C08E5/HOL8zvafDh35yU5bcpN7wyiBJ0xP/WFUsnDyFH5X9DZYyJtFkEZBAR1zRw82G oPCtUUINh0rArZBK1wGrH7YYuXBW54aIoYHbvVPPO7dxePlIh/o/jZq6A1EydjBKjjwU f9Uw== 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=U2bUIY3jlZNqRQT7LBCuDAObxV24OjoUZQ6VoM6FH/M=; b=BdIDBC/dLbatnNpJ2l3IMJ2RyYN2wHwxbgc7+mkjhHH+VrkwA9mZ9AvxhuqZiZRs7h +ZAA8QIodxBBo3ipTHwtZE0JiEe8E+fqv+X9hugaxSiUYDYm+EwufWzUxc3Jk946l/3P CAZUeC/0RMXqpgwkS68W/WOdyXQABDqi3669scK1s6pM2l7TkAV06RoOd0ikYVjS+B1x kC/urwrghSkWGXKjZilvMGVZd3zkXGpVzAd5pyHNyGcWcqITbPS6PR+r1r2E5V+FkLWV +GPf0e3Ix/wP4IQeumMKcOfguLqkCTyXhSTkDBZtjC7xafZFUGIeB8hJQVRQLjQ9h85I qzlw== X-Gm-Message-State: AOUpUlEu/vS9AWNU2tUcp/sTD7vGoOg8PBoPjFfuz4kqa+b3XeEFvBz2 F09KSatJY1t669Y3pZq/vUE= X-Received: by 2002:a17:902:6a83:: with SMTP id n3-v6mr5321171plk.246.1532683903086; Fri, 27 Jul 2018 02:31:43 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id n18-v6sm9331893pfa.50.2018.07.27.02.31.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 02:31:42 -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: bcast: Replace GFP_ATOMIC with GFP_KERNEL in tipc_bcast_init() Date: Fri, 27 Jul 2018 17:31:35 +0800 Message-Id: <20180727093135.7469-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_bcast_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/bcast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index f3711176be45..9ee6cfea56dd 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -512,7 +512,7 @@ int tipc_bcast_init(struct net *net) struct tipc_bc_base *bb = NULL; struct tipc_link *l = NULL; - bb = kzalloc(sizeof(*bb), GFP_ATOMIC); + bb = kzalloc(sizeof(*bb), GFP_KERNEL); if (!bb) goto enomem; tn->bcbase = bb; -- 2.17.0