Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4133285pxk; Tue, 8 Sep 2020 11:30:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwijhU1WZOLPAVw6sRJdDHjY21OqcvKYqSM3HXGLXu0A7L8vyDmnAIGdKznf6FCLA6RfEan X-Received: by 2002:a17:906:4754:: with SMTP id j20mr28262835ejs.293.1599589842471; Tue, 08 Sep 2020 11:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589842; cv=none; d=google.com; s=arc-20160816; b=LqM+eNksQu9nTLipavoIkVJjT5yVNbdyYj7g+EUh33Vt8K2EYJgtqzRA8sBI2mgjgn 2vaBlfp/0zAGZbxQd0iqpJrITHgcZ77alS/8tUWFWznUntfLj6shwzDe/8d8/ki0dZno wciELqkjeJwzzRYzqwdRCSDD+iu+sIiKEApvPmrFzl5Yxj/Yo3CRDNjBFgphhWjs6mn7 b7wy4iIF5p2Hr2OBwyjFrkz4npILXY0fF3kNHnYwnD5vywTA2b0BkmrCK9ORw5PVtRmC ZqJilm3ApB01vCHISqyF6U1NdMh22bo1x12Qg/P5dDe6FanRD6IpZ67itZKF+2LnEdOh zb9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8LzrOdrXqAWAx1bbj+U9+gDSYRZpMVsMhxOCvAZNsno=; b=XaOjEROAeHufdVNNgInOwPlaHfCU+i7hqG/e+ZQkfGeESjN3fzWBtfJD0wvuplzvYu haLHRfzPo6iiw6zfe/JnFr2mJgAse12t6t+JzVbiHcJSO7xAo6HUKxu6dlgnyYc1bnWG t5e1Xh3SfnbdnDJDBPDgvddMW/AlyEChI8ilmgjqVuqotEIosrNSYdoCH84uAbbyewLJ ykTR9ogwiY88vlpfsb4guWgRtDiDUsvAscFD2LxgPfB8hWocVR7ACvJrYVLfkmyO+M8j zqpr0JfSsM0i3xlsX6AUf/S6WP7Xj/NP3IiXOHvlR11IISC2Ik+U2lWDBdxNuL/Hl/V+ WQvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gqpp2pvC; 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 f17si3561907edq.587.2020.09.08.11.30.19; Tue, 08 Sep 2020 11:30:42 -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=default header.b=Gqpp2pvC; 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 S1731777AbgIHS3o (ORCPT + 99 others); Tue, 8 Sep 2020 14:29:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:56078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731409AbgIHQKZ (ORCPT ); Tue, 8 Sep 2020 12:10:25 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1277424806; Tue, 8 Sep 2020 15:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579799; bh=yVzu16jkR+ZSizyDraX6CgN0pG7oqdVsMdzwGZ9bSn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gqpp2pvCKDpLa1Hac3KUTeDfadwHIgNa3wFim4k1Z66aXhcorGMUvqM0UD9THtjPp 4Klk6UbZGtRZ+gh+ra8JGWxIMFnpdKfsK9mEOac2X+9p2vVbVRJonYVRE5SpWNaEEs jP/W+XEHV30tqQkAyYQZP83+BPDGh9aLl63JMUY8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 038/129] net: arc_emac: Fix memleak in arc_mdio_probe Date: Tue, 8 Sep 2020 17:24:39 +0200 Message-Id: <20200908152231.581109549@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit e2d79cd8875fa8c3cc7defa98a8cc99a1ed0c62f ] When devm_gpiod_get_optional() fails, bus should be freed just like when of_mdiobus_register() fails. Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver") Signed-off-by: Dinghao Liu Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/arc/emac_mdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/arc/emac_mdio.c b/drivers/net/ethernet/arc/emac_mdio.c index 0187dbf3b87df..54cdafdd067db 100644 --- a/drivers/net/ethernet/arc/emac_mdio.c +++ b/drivers/net/ethernet/arc/emac_mdio.c @@ -153,6 +153,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) if (IS_ERR(data->reset_gpio)) { error = PTR_ERR(data->reset_gpio); dev_err(priv->dev, "Failed to request gpio: %d\n", error); + mdiobus_free(bus); return error; } -- 2.25.1