Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3777276pxv; Mon, 28 Jun 2021 12:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR2Qf2r8n3m6zbTgdtIqhCaHiwmQDbOBFXHU7gQmPA49axttsz8SYDPXRCH9tKQ6tlIBtU X-Received: by 2002:a6b:f60e:: with SMTP id n14mr843536ioh.179.1624908975255; Mon, 28 Jun 2021 12:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624908975; cv=none; d=google.com; s=arc-20160816; b=rYKx4cWE6sVtsoBlesaxAwrwNu4hkHBkf+veOYoL9pM+PvBMd2QGdCOQEBOj/ENlA+ QK+28DPDx3A/jZsrXt1tVyHQcpQFqLmRtcVwUuCp97vpZRkB+XvOyH7WW9WZfsLA7TFt kvgH3XInP8dIj1OwlRKPcb+wMhRs1ZJUZOgsLePwNmFhseCuD3946gKYy7UdkkQI9cUN zJN1fWFKgUUNJcvR7t5O+kF+zCRaNHEW4UtfbMYy8Q8VFMxr86FcD5rlLZLzMOr4g3O3 TnHrKJvUHG2mZgpfdwxuuCuPZPbEd4G7IVP5eVdMJuGcvFIFQSJy8KafwW65ZWqKSG/G UsrQ== 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=KJ2FNTkIEqqh5QVdUj/d54KjozGfifxOEoMkz/JDRrM=; b=c7saAX8SjuS7vHn/55ecPnyBR7ekveWcUwUz5GUUYjd/tRxoe1Qb0f7vcgqZPBCl4d /OhQE6ZImHHX3GcQZ6/jxvqpym/Ads2p2uFWj6SkVnseKFoQ5T+d7iQGGpcijianl71h 8ii28NdZMic3vximNg1sLY/ZL6oBYsIQdvXGd88QcS8fgVucvm3Ya7OQ9+1F46CskwdW j5pZqQbHbV81w6ycxC8FI0hwKsh2hsFgE0m3A1qe0fwBGqQ2LPXrrbwzGBEE2U5ZYZe+ sph0LyRJbshU9RJ0XFNPN7Eb0r3of0Gu9YrHK5DE3bOlrQJRQ4ZWpCFGBB1YbbFivwuz O85Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U5bMKtDr; 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 x6si19806122ilv.67.2021.06.28.12.36.03; Mon, 28 Jun 2021 12:36:15 -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=U5bMKtDr; 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 S236216AbhF1OzD (ORCPT + 99 others); Mon, 28 Jun 2021 10:55:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:50214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235611AbhF1OkM (ORCPT ); Mon, 28 Jun 2021 10:40:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4FDA61CC4; Mon, 28 Jun 2021 14:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624890802; bh=hr2/c60Q5FWoGRk9+/fstlgyxlH/GO5PPiTTaHnAlFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5bMKtDrd9YGn/nEKnas23SptAlv7FtA9Xy/LoZ77FUa2ssVjWm9HrLzmyJtUN+kQ m1kTc+vlvMKyHpflt+FV3g7MINYFolF86KgKFVUnNNOIjGlyRTSL2wQlZFmszx7yyf nNy1hgyE+6CRNK8ZkS769NstY6hozqsSmUXN9RSbkeN+5tjzeWfpO7uyMxD4zpEUYb XAu9zlZJqz5t2whplHMMpwIm0Czqu8WA1pFWYDWwQEighdTbmRmJf/ZalElR7o01US SMVpD4MtBi1q9aUOpYXt/RMrMu42ZbEIhQN9dNU7fDjyIgHEzbuJuAtSWO33uzDN6y Rp8l3HPWIQkng== 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.19 017/109] rtnetlink: Fix missing error code in rtnl_bridge_notify() Date: Mon, 28 Jun 2021 10:31:33 -0400 Message-Id: <20210628143305.32978-18-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143305.32978-1-sashal@kernel.org> References: <20210628143305.32978-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.196-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.196-rc1 X-KernelTest-Deadline: 2021-06-30T14:32+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 935053ee7765..7f2dda27f9e7 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4102,8 +4102,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