Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2877591pxu; Sat, 19 Dec 2020 05:05:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyIu8d3eew03oKWl56eoRJD0h7XQvleKLi3tVwBo4TNoSurc+BvM7w+zgVuU5OKtge4NhQ X-Received: by 2002:a17:906:5290:: with SMTP id c16mr8433938ejm.188.1608383129939; Sat, 19 Dec 2020 05:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383129; cv=none; d=google.com; s=arc-20160816; b=GYlmiX19xWwvsOjeRXUxS/Jjb4P4fl10D9Xn/ByTEXMEbUOUkqxLl71ReJoAIE03CV 0bJQ3vtZHXA57/DWXIk3WtfdkC1hw+SbzuI2OMcOvcAZyuBFmd9cj/qloqzPfNveR3zq /y+GF/FTTLOogwGKgYFibSt/FUR48DnCgBOKiYwmSUVx234iSfTgM+X77Rz7oLNpPaNK 3VYWKRLrDkwUFs1hPSIps05gIthMf2CcibnXAVgsf/GsWiNLn7B4YrWjLWaR5hKIetN3 XuMfQBVeGUVR1VV3wVCnKB+xwse1LP/sKRvDdsZYgvtuDyNKTsoSuTPqYjea/rjor+78 y8uw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=lDbhM0kKaHlNco0JaXtj559VkP/xX0eRG75CaOHjMB8=; b=GivFnBZJ0C55vhjjKNWe51H8/oeUzZTb5Il29MzE5rHT3aUyP3jp1wns1tW5ogfd7/ RHrdVScqkmEZ4MSk6nZ9Uvdq5vtjUr1t0ERk8hvyiV/BJmJfGJWlpNSVfxWhic9OvT7Z csdf8/8miSSpd2ZidNiOSkzvhmLthrR2BZLl1bFPI2CZ1Wzxj6twej7thmMoZgpcKA36 SuQo4a9/YiJqYk2FBGMjq5e4bQ8cKKAZSoDDsWDWjwktVZJGjjU/gLDcoiVUVrmwAgAX 59QUjLJpi74yKxE6en2/m8hp7RwIvagKvAC2ve97tQkwJwTlA2aeVcGrY+lIB6P96dd0 gfMA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di13si7731630edb.412.2020.12.19.05.05.07; Sat, 19 Dec 2020 05:05:29 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727489AbgLSNCf (ORCPT + 99 others); Sat, 19 Dec 2020 08:02:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:45836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbgLSM67 (ORCPT ); Sat, 19 Dec 2020 07:58:59 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , David Ahern , Jakub Kicinski Subject: [PATCH 5.9 04/49] ipv4: fix error return code in rtm_to_fib_config() Date: Sat, 19 Dec 2020 13:58:08 +0100 Message-Id: <20201219125344.891904723@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Changzhong [ Upstream commit b410f04eb5b482b5efc4eee90de81ad35d3d923b ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Reviewed-by: David Ahern Link: https://lore.kernel.org/r/1607071695-33740-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/fib_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -825,7 +825,7 @@ static int rtm_to_fib_config(struct net if (has_gw && has_via) { NL_SET_ERR_MSG(extack, "Nexthop configuration can not contain both GATEWAY and VIA"); - goto errout; + return -EINVAL; } return 0;