linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>, Peng Hao <peng.hao2@zte.com.cn>,
	netdev@vger.kernel.org, Wen Yang <wen.yang99@zte.com.cn>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>,
	Zhao Qiang <qiang.zhao@nxp.com>
Subject: [PATCH AUTOSEL 4.19 151/219] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe()
Date: Fri, 22 Nov 2019 00:48:03 -0500	[thread overview]
Message-ID: <20191122054911.1750-144-sashal@kernel.org> (raw)
In-Reply-To: <20191122054911.1750-1-sashal@kernel.org>

From: Wen Yang <wen.yang99@zte.com.cn>

[ Upstream commit 40752b3eae29f8ca2378e978a02bd6dbeeb06d16 ]

This patch fixes potential double frees if register_hdlc_device() fails.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Reviewed-by: Peng Hao <peng.hao2@zte.com.cn>
CC: Zhao Qiang <qiang.zhao@nxp.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wan/fsl_ucc_hdlc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 5f0366a125e26..0212f576a838c 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1113,7 +1113,6 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
 	if (register_hdlc_device(dev)) {
 		ret = -ENOBUFS;
 		pr_err("ucc_hdlc: unable to register hdlc device\n");
-		free_netdev(dev);
 		goto free_dev;
 	}
 
-- 
2.20.1


  parent reply	other threads:[~2019-11-22  6:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191122054911.1750-1-sashal@kernel.org>
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 106/219] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 107/219] powerpc/xmon: fix dump_segments() Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 118/219] powerpc/perf: Fix unit_sel/cache_sel checks Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 119/219] powerpc/32: Avoid unsupported flags with clang Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 120/219] powerpc/prom: fix early DEBUG messages Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 121/219] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 122/219] powerpc/44x/bamboo: Fix PCI range Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 124/219] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 132/219] powerpc/83xx: handle machine check caused by watchdog timer Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 133/219] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 134/219] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y Sasha Levin
2019-11-22  5:48 ` Sasha Levin [this message]
2019-11-22  5:49 ` [PATCH AUTOSEL 4.19 217/219] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122054911.1750-144-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=qiang.zhao@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=wen.yang99@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).