From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 879C6C54EBE for ; Mon, 16 Jan 2023 16:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbjAPQsS (ORCPT ); Mon, 16 Jan 2023 11:48:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbjAPQrs (ORCPT ); Mon, 16 Jan 2023 11:47:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2E242DD1 for ; Mon, 16 Jan 2023 08:35:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A99D6108B for ; Mon, 16 Jan 2023 16:35:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A1B3C433EF; Mon, 16 Jan 2023 16:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673886923; bh=a1zDYgg3OFV2ghETo/NBYZxc8BXe2XeaslW5LB49eQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZmXYO8OWkCWrrV5BZJ2ETIJMtyW7judQ+mPIj6vNvcYm5qwTXDALhJV71EB2deYQU zFyMgvtrqIFaKMOr/jrV65Tf49NQshR5C660z03hIFXhgTtxgNJPyKFDUoTEJ3uxyQ c6E1AHgMB1AAyzTSW1HWSCEFCg9ToaQjn6nhei8Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniil Tatianin , Jiri Pirko , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 583/658] drivers/net/bonding/bond_3ad: return when theres no aggregator Date: Mon, 16 Jan 2023 16:51:11 +0100 Message-Id: <20230116154936.165530372@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154909.645460653@linuxfoundation.org> References: <20230116154909.645460653@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Daniil Tatianin [ Upstream commit 9c807965483f42df1d053b7436eedd6cf28ece6f ] Otherwise we would dereference a NULL aggregator pointer when calling __set_agg_ports_ready on the line below. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Daniil Tatianin Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_3ad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 0d6cd2a4cc41..0c4e6fcac58e 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -1529,6 +1529,7 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr) slave_err(bond->dev, port->slave->dev, "Port %d did not find a suitable aggregator\n", port->actor_port_number); + return; } } /* if all aggregator's ports are READY_N == TRUE, set ready=TRUE -- 2.35.1