Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3882415pxv; Mon, 28 Jun 2021 15:35:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsFBKASmjS0uGmvLMdBP48j0jhtcAErYCGoHB+dowPBmMsgsRXZhZfIjLWUH3OoyIp77pW X-Received: by 2002:a92:1e08:: with SMTP id e8mr20349142ile.10.1624919736915; Mon, 28 Jun 2021 15:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624919736; cv=none; d=google.com; s=arc-20160816; b=zMpFjc5ALBC1eFnbuVgPTWUygVR5/PL2TA5RJd8yUvNFxWb19D/rWlEM6Q7ElMrFHz sptlyPk65dGwIua0+IrjH4Uwwz17M8/FgJpA9x6sas+uMVQwP6GHFtiRPG2bJ8aqcPOq DjymiC8S96iRtz8+nlsbBPIHoaO6sjEOpqSzyRLVlgP2uqWGxZDRCO3JiFGanVd4GQ/q U3hZhrt9aabTtAxj9OlSucA/m8Vn561MjGbolJU7+SFML6VaVhFD8IHWFYXsw7xFnlyy WpgHg0hrtsZZtbfkLXQ+cDzUBOB2bONyX1QQLmVaT380ZzHiyFEn3o77ZOB8JPck+1pc Ccaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9w6iQfz46Ip1vjkKS/y8kNJyFdDY2RS8c/4q31TRwfY=; b=s+0nuiy06eBJABYPhUw54vMjyEjhB+4Gw1K1EVAGpljejL/gpFWH3szL9zPCMoPjcy yCxc21QoAIKBwd0qgvb0Pn9hLfeIBtyG2wgQIoIai9IrAHgswX8hSPMA8h2dgIeQx1uw m2PaM0o7fXwUv4kMxhCZ+7BMbsWT6ybAbS0wIk6OV3lqFApcmD1vDeOvyMcezR2ZBn7Q +hG+w0O2JqW8ZPV9wfrcbwe9dhlu+yIN9LAHOrFNVcs0In0dKNXF4BySgE7EOwGuuKWG uJEjFpLunL/6ranMT+zPz+902InQHkWlKlVJrA0V/cltKtQktETL5/jm0mW0zVnnOa45 wR6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tMyRhppO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si242381ilc.117.2021.06.28.15.35.23; Mon, 28 Jun 2021 15:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tMyRhppO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235195AbhF1P1y (ORCPT + 99 others); Mon, 28 Jun 2021 11:27:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234753AbhF1PDu (ORCPT ); Mon, 28 Jun 2021 11:03:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8029661CDA; Mon, 28 Jun 2021 14:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891387; bh=HVjKU5j5ADRcQuZap9hsVaBsfM9OKQPMVLRn/zeOQCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tMyRhppONMnAJEHPd/Vox9Yfdx1sRfmuPiYdlneT1BXUqJu/uGf8SpeKPD4PHjNwX ZYDq0EY7FJ6rwXB6VWydDWQuB4dAgqrs7uKDC8ULC2v99bpZA9iTz0Hekl/djTEVu3 27FFz8hmyz1e/9aoSmA2NXkLaUe+/+VgD1dd8JkwYfBXEn/M7jrIVXr/87OaKH6+kM nRuyZOBx27SahX0o+hOc/gzXjpfUvgk22/zRQPmg3atqAP6j05EVwaAX+fFF96BC+4 MDNA9lOgNwAzstfCBiAuM8cmUne9cLDd7bIrq8vqeZ/NFqhTAWTsD1MTlGZClp9lNG uFuZX1Ebk6EDA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiapeng Chong , Abaci Robot , "David S . Miller" , Sasha Levin Subject: [PATCH 4.4 10/57] rtnetlink: Fix missing error code in rtnl_bridge_notify() Date: Mon, 28 Jun 2021 10:42:09 -0400 Message-Id: <20210628144256.34524-11-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144256.34524-1-sashal@kernel.org> References: <20210628144256.34524-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.4.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiapeng Chong [ Upstream commit a8db57c1d285c758adc7fb43d6e2bad2554106e1 ] The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'err'. Eliminate the follow smatch warning: net/core/rtnetlink.c:4834 rtnl_bridge_notify() warn: missing error code 'err'. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/rtnetlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index e2a0aed52983..11d2da8abd73 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3240,8 +3240,10 @@ static int rtnl_bridge_notify(struct net_device *dev) if (err < 0) goto errout; - if (!skb->len) + if (!skb->len) { + err = -EINVAL; goto errout; + } rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); return 0; -- 2.30.2