Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2275756pxb; Mon, 11 Jan 2021 05:50:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0X27nX7iH5BujiE5PBbBlNAdq5E32pqf31RCU6oM9v84NFemNbKZarFKTjUNUmSU7ovQ6 X-Received: by 2002:a50:b282:: with SMTP id p2mr14853417edd.210.1610373005468; Mon, 11 Jan 2021 05:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610373005; cv=none; d=google.com; s=arc-20160816; b=f+vB5wEyUuTA+lO+V9nTtz0SWBp6b7hzvC51nzIWY117xjQv7kdlu+/1+glSVJZZBX fmXfayr8ZhSrx1d4N8BKNo2NSVo6j60fYx9VG+BhpKrA5TJ4TTc7rkwz6x2ivG7RuKQt h0etTcll/NIpLelTeaoXMdQMdhkRB2l5XCh5blMeiO7otSLIfMZVZ52Ywh6q6BkqNQat bNOQJ7INBw4qz7nHbJ/Ll458rGXFvinEoE9ezxehely2k2ZtABpBdGBJLXZX8SkgMHv1 OsvI2yVQ76ij7oGu7iooxucpUJAOBcE01lyxxkXf6qiM9KVufcPcShwIPDcusxjDfeDj xHBQ== 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:dkim-signature; bh=vyDCW2RCAP4aqXb7LGfBbF/FCjx4Gw+p2qY5S92VO9Y=; b=MPvl4morCbyXQCQi6jLMuxJdIqzw0bn81KW6E7AKFgSnYxr89bnQ0v3kcR60KHdUj3 gUBM8c0HFNDeoCXLu23fQwZEU5mOkgCMUDrIReXi2mUUospOMF4SJ45NC4egY5peNtbs MLFkYKjr+KEypCMXUEcyeiXRtN2NMOtIZtz6EnGUkIpXVMnnvUCH5qYsHr/f0qQSnE4Q aUS2+kXp8Tum+LXZQ9QM/EJxiLImBUMBYut24Bq4X+xf7FjQtQ6PkhmNIpVXvhXsS4ZA 88Jgsm0nv9th89SV32+oAbCOehI8HIryJepMrH2tDGD50Lb7HHkWwAQ+E/Tc9lBM2Hm9 j33Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C0onDa6e; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si6643153ejw.721.2021.01.11.05.49.40; Mon, 11 Jan 2021 05:50:05 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C0onDa6e; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387456AbhAKNqa (ORCPT + 99 others); Mon, 11 Jan 2021 08:46:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:58080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731278AbhAKNKv (ORCPT ); Mon, 11 Jan 2021 08:10:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CCCD2250F; Mon, 11 Jan 2021 13:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370611; bh=QvmCKY8dUPY2jKimtVqqmR5Ges0Ofd9MXp7WqARN9WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0onDa6eVhctpvBcmYnXkoAC2o7eKLcM1gBx58ZiW9gsFJMhwc4yngE3r/8xqISzF 2iRv+5EhwIhmCKSdopsVUMjSfmX0PjiznnLWlY7tNn0SSADYfpKxOxl2JCTS6FiOvk mdC98tP3kKFk4fFtA2ZzjOtJRfu3Q/GtU5nhgxYM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Jakub Kicinski Subject: [PATCH 5.4 20/92] net: ethernet: mvneta: Fix error handling in mvneta_probe Date: Mon, 11 Jan 2021 14:01:24 +0100 Message-Id: <20210111130040.128418421@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@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: Dinghao Liu [ Upstream commit 58f60329a6be35a5653edb3fd2023ccef9eb9943 ] When mvneta_port_power_up() fails, we should execute cleanup functions after label err_netdev to avoid memleak. Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode validation") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201220082930.21623-1-dinghao.liu@zju.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/mvneta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -4694,7 +4694,7 @@ static int mvneta_probe(struct platform_ err = mvneta_port_power_up(pp, pp->phy_interface); if (err < 0) { dev_err(&pdev->dev, "can't power up port\n"); - return err; + goto err_netdev; } /* Armada3700 network controller does not support per-cpu