Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3855633pxv; Mon, 28 Jun 2021 14:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydau57HrIx2FmTz9qRrJjtoxlIB7q6ECML+F+/lyawKPnDzDmQZ07YMniPGfRwMufpE0ZC X-Received: by 2002:a50:fb81:: with SMTP id e1mr34657789edq.108.1624917007743; Mon, 28 Jun 2021 14:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624917007; cv=none; d=google.com; s=arc-20160816; b=wRZbSmZuDD6FX+f8cPzYiI3Ngtz8n4K/RENqqY0JwlTI4j5ng6Q2jlRYNntfYwTPJF zZgWfePkekmD/3paVVU5O2ncoFkJVfeMD/DzzvfRG9Lk4YF1/whEGkkvhjLRCmuVGL8K b7DALaBkYhrjy+lW+7jKaONgahXWJ6AvAi+MXruGDjGutJj228zZjewGTdcYrmI0DESN LZ/dAcTf/LusjooVYM7+xJkeIynG6zrZE22fcLHRu+0aXGPPWIeSjehfj1F83XtfyiZt cok9I8ko4yoSE+hKnQtzoiqjaucjbsA6YgOHJQjCN2FEmM46QhLiykk0fpMlIdI+Avc8 lkMQ== 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=PAa6y6yhcp5CVfOdAjZb3GTlXmhJTNNh+7+VXovrZb8=; b=pPawY5GqTDw7MjOSFG3KxqehgEYYLNgvkuVGVJupe7D4TnsMdOh/pVRnhKemWEyLeQ xTRgXRhU5SS8pOyj/Ufbx6uunK1iDY6wv59WXwRz89PcYXfqvY20Sy+/aIMGuOae5rxM SxwyJfVY+gdcl8jryXRAneJAWUZcndIl+x5602qWrd8u3z17LoGFe4CLOKThy2wYiWsr Mh8ug2EoRq+dyyMPwLEOp39xi9VJ+E8h0ipJJ+gSWK8Qq2FE0x4mqRpHqQh7ePa5fPiv lxNzxyDGTW0rVaHLqwnKEZwEmOQvsl0A0JXMV6E1noWzmS21vZdJVFYEDp33amvt6clV 9a/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ujztl4Nc; 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 hz24si15115427ejc.547.2021.06.28.14.49.42; Mon, 28 Jun 2021 14:50:07 -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=ujztl4Nc; 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 S237038AbhF1PTP (ORCPT + 99 others); Mon, 28 Jun 2021 11:19:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:59556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236954AbhF1O42 (ORCPT ); Mon, 28 Jun 2021 10:56:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 23D9361456; Mon, 28 Jun 2021 14:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891214; bh=M1QyCXRvpSYSijtHHKzZN+F7q26OVf+B+7fL4VCMB3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ujztl4NctlEcyVxmSn8lTPthmmZr40j/VBk2QSdeDgh/9xfNZzT6sNa1mY2Gw/8Mt rGmI1z5XGovvt3J08NyPtrSV8qwSF/XvU2gssZbbt51dnlqUX5hGi4FfE2pFJSnNMZ HqAaQwo1xACr60PYlEv2JjRESP/zRpYXlWLsBEIMGd90dNAud/G9nVYYffyXJgfysv P/Ac46aTJnJJTyrXDpRLcs21doJP+uKJ/HApDjeeMggkS5XspVnMUFg3m6cuH8AEFq mQu1g9bsQy0YfPy9oIEROdiCttYtkFmR0aZBND8CWEfj2ZGWnCfc5uNFkY4aPZrOxp Kg7h0Rg5k+MDw== 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.9 11/71] rtnetlink: Fix missing error code in rtnl_bridge_notify() Date: Mon, 28 Jun 2021 10:39:03 -0400 Message-Id: <20210628144003.34260-12-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144003.34260-1-sashal@kernel.org> References: <20210628144003.34260-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.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.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:39+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 e652e376fb30..93de31ca3d65 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3530,8 +3530,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