Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp422447pxk; Fri, 11 Sep 2020 10:26:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbxYKqvheAEnQ/JMzlF06IyRhdYl31nQYsblQoKG7aMwmyhhhYSZTVSG7K6UgvR0J4Hy48 X-Received: by 2002:aa7:cb8f:: with SMTP id r15mr3391360edt.356.1599845186556; Fri, 11 Sep 2020 10:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599845186; cv=none; d=google.com; s=arc-20160816; b=xCmX6ick3tC4tp9a45S4Ph0mFyjF8onPw8fuEszsOwgkBBGdP9DPtOMuFSGpr5/Mbt 1faO3kcbgnJNIc+1U+aNz/GW0Ro5Oq+q7VT6zQcjhhit9elmqYHoxovhLWEWIhacxeCw 21Wklr5JlxucBkm3zC3EFvr5s4XILr8iAwnFAjIwAdjHWwew769bPIU4rnsAvpATbvq+ esyq2rxeKsdNZWFRwNQfGJXs7tFWj+YM00yaJEKz5/9vpupLgnZXXpGanMYtaApajEbR ErJ6sPYEkNfsjj6xMdfRLjQqQyfl8h/aUZUUkndSRrW9qcP5kxm6NQlzvkCnI5IF1Bq+ HulQ== 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=7Te2kOX5ps8VB9o1aR+tNu7ojb7F7jD7CJ9vrSOsCCk=; b=X3cDP1rJ6YCy2Ic8mH3q7LZBUs8/NgBq+cEH0JJaE3GGupZgBrNr8mTMXoWVbMeSMs bkIw3dk2w17iDBfKkeZf7ALgVJ+VdHQIXmpCxvjckYYlLokYIGudacLfx4AqHjz6xblu YE61DvYO4s1imQOoPuG/dWHcHixLRRzRMYOz44j9ZLnEjOEpFCfTxncSOw/BMHGpbsPA 7Oq4Po9RMfQUBUSQdj4VskaJ0L5GUS6ttQ/uQa08/DM1G8xL4AFkdMgiGNlC5o+A+iwb e6ehm80noIQCuapVCAAFILmgubhPmGvyH21p1cXxyicPqdgmqNXrfY9dt3kC1d0zS8y+ Uljw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dtIucj3o; 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 t17si1627371eje.331.2020.09.11.10.26.03; Fri, 11 Sep 2020 10:26:26 -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=dtIucj3o; 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 S1726212AbgIKRZe (ORCPT + 99 others); Fri, 11 Sep 2020 13:25:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:49906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbgIKNAK (ORCPT ); Fri, 11 Sep 2020 09:00:10 -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 A862D2226B; Fri, 11 Sep 2020 12:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599828984; bh=p6uNEAiri0OzZ1/93DJ8TG7PHf9aP2bTZ9/fkANWS+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtIucj3oT+uGOUyKrsmjO3eHGI0wnfDvIrph9x32EzR6KjODliT92FgTt10PR3tIL OguleYa+I1ndlGerWxDKLNOVBMZVECGn9AHFSMdta3DRfiq0uCyOH3db5U6bYVMhdd mkoztpB+fEytdUpFyBJBhFAkqmgWA35mdIlGZiwo= 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 4.9 20/71] net: arc_emac: Fix memleak in arc_mdio_probe Date: Fri, 11 Sep 2020 14:46:04 +0200 Message-Id: <20200911122505.949211751@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911122504.928931589@linuxfoundation.org> References: <20200911122504.928931589@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 a22403c688c95..337cfce78aef2 100644 --- a/drivers/net/ethernet/arc/emac_mdio.c +++ b/drivers/net/ethernet/arc/emac_mdio.c @@ -152,6 +152,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