Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3593242pxv; Mon, 28 Jun 2021 08:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtM5E0rbkA9Pl1hIP4dMDtKhehvq5B2nZLPCe9/Vv3oOIfUOpweNlzq7apJ/Tqg+0sl2pi X-Received: by 2002:a05:6402:40c2:: with SMTP id z2mr10494979edb.134.1624892976857; Mon, 28 Jun 2021 08:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624892976; cv=none; d=google.com; s=arc-20160816; b=dt7Txzt1/wMditFxD3eDc6XSX8WeouV5tIeccRazSbd+++btnameOHzCPP1HnQgBbz QjVnOLUMAH2NKBBXBPric8ON4KqRcbJSwMErcDzaLMHxEBNVN57uZua3n5mH65T6Q8qm ye8039eRUmasUT0HKCJcxcUa/Pd7EtZrbwwOiaLaTJg+H+CivH/xGVS4zoyN4fhBhDdf YFTe5PXXRfaIZNZyZqzs28ouQ8W3gB/tPSPHQ9sssyWVOQ/CPg9QgGadLqEwoUwTr/2m PQiLTr+0cVBkrN0amEzI4bUoJ+AUZKHDBKe/jQuY6FFiNMJYZZZ5Sejyf/SWInd0H5mL My/A== 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=U3ss/9Rhi397XhfWnZSADv7QV+EVY+dSkGmVBbo/Dzc=; b=buvnTeA4Dzu8WFkVy62vEM1ILILgiKuWQ1XJ3i7lw6IlfvNzaiEUHdYYiTBZFEMeXc 1uQjf7lls6q/h5PdlaTVEEiI8f93jhGexgGi2JLY2BCkY25BuxcuinzsYpzh2N4nAoNR L3QVvp8Li0iuRXhYNvXZmAOZYiGoBZPrgdTP2+pLxT/H5838WUCWLwWE3UV/rCBlk69J SWXrEJ5jCy+esM97awf0meVkgscHip9FIwCoGvlO6ftDPdPsGEdDWhB+wxqiRN8s1FAS 8PrTuxYd0JnQUlNXrzSUmieSbAexT1X6TaTA9bRZcravMA7req29yPdGzahGnhVyW3Mr I6jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HPYPP8bo; 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 w11si13320765ejc.737.2021.06.28.08.09.09; Mon, 28 Jun 2021 08:09: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=HPYPP8bo; 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 S236120AbhF1PJC (ORCPT + 99 others); Mon, 28 Jun 2021 11:09:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236406AbhF1OsW (ORCPT ); Mon, 28 Jun 2021 10:48:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25B9E61CB3; Mon, 28 Jun 2021 14:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891002; bh=YPfVsIP4uCZ7IM44bwqCjKcDi1lb2f8isXM2kOjgkkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HPYPP8boh9KFI4weIqGj1dZX15twVtWgFdZ2qzz99xRt1B5JDw7K+hIDrDH9WGcYy u12jd7g1Tdl6WWKBsJY+e/Dq8xhVEJN5PoPcXio3MEd9oSOtEiEweWvUfo4u7K1Ogc xn78vI4/c9yYPgxVPyatxX0L+NEQWccsturGwJ0rlEhMcs0q4ibRemQ0YXJq8sFFQU swSLYKtLSziQeMQIto0AQ4F1wa7rSunk+6JixarCeplYWiSl8gittz6D5Ojgx2379L Mehsd6KFm2C6nvnz5t3iRnOb9FpYfQzxEBO2+30E3s8wPO3fdpm9/5EdUA/sJZPfsk fb8ghjOhKUmYg== 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.14 14/88] rtnetlink: Fix missing error code in rtnl_bridge_notify() Date: Mon, 28 Jun 2021 10:35:14 -0400 Message-Id: <20210628143628.33342-15-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143628.33342-1-sashal@kernel.org> References: <20210628143628.33342-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.238-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.238-rc1 X-KernelTest-Deadline: 2021-06-30T14:36+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 0168c700a201..fa3ed51f846b 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3648,8 +3648,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