Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4590967pja; Thu, 21 Nov 2019 22:26:31 -0800 (PST) X-Google-Smtp-Source: APXvYqz3OI3pM+qjAqvk8uJnlfs7IeRYmb9sWN84u1INzDphohNQE+DvCymNTX6BAcUiBKqCrM1H X-Received: by 2002:a17:906:4dda:: with SMTP id f26mr19950828ejw.89.1574403991338; Thu, 21 Nov 2019 22:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403991; cv=none; d=google.com; s=arc-20160816; b=k/JeVSZ5mE7Y1VoJeSrXx36stg4MCgHxpt9tAxuJNLydP/h6VtmS9ME5GrJ6o/q2rO Hmv5+FwAMpBWUd6WF15xWxcJV5R7sx5xIwgy8SFfsvNSMIAdwo4KyWPeYSWc+PvfVjZn 2FhsHzZqBXXzDI/Su0c9zX5vpFsX70qswpCY0glhZGNAUCpWJK5Upd08Y21lhfmvzfYK Q4KIry1HMYJlxhw5UE45uCHgN4rRULM/qO10KZ2X38Mjz566HmHj/zYKvrqY3TXUFemI rH+asieey/FPYfLCyQuoZtnkm5Ke2Iwtt2OfbSQecVJ6V01UwOCJ7HasngFkx3T8pNMd 5qsw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lmXOU/8oPHCWKzRpBFI7QdzPPe2cw99FfezXVtA5g/Y=; b=Ax2J0K6MoXM5XhYwQlOq7lfL0JznOH2CJhuwNS/hqFih5En0e+EF+DO+lHK5BgayJ+ EEz7rTLm5NfUmMY33QQdyY7Z1H2ahwPVxJutmUO9WVGAjWPUW2dckKp39lqYWieyEEEp T2uCZO6KzoQvCgkCNeCG1IF9V/1dobqN7qmF/RekCYOExihr+DCNT901U1pJT+NYzHFo aLB/HoaokvKZyqjmOgTKydGqS5RN8UaXbUjSGec/LNSKblzQ4Q8OJ7A0loMYAKOCkseP lQcmSEyJrjeR+6Kfl72Pd4VBrgfMwQj1M18B6xePcd1B6oINTpPz8OLlYy4s/RoU8mxD sRZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q5z6UGBU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si3333721eji.80.2019.11.21.22.26.07; Thu, 21 Nov 2019 22:26:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q5z6UGBU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbfKVFwM (ORCPT + 99 others); Fri, 22 Nov 2019 00:52:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:57406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728378AbfKVFwC (ORCPT ); Fri, 22 Nov 2019 00:52:02 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3FA62071B; Fri, 22 Nov 2019 05:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401921; bh=pSfYKfebvfswSMG9aERDVNa+OxFdxdH6xAe+7HpCZGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q5z6UGBUfK586y5/CPBQeIGcqnjjNx1txP4ipEA5rkHmZdESi5DIylMWsNhu1Qywc VO0lExIQMvso1W0TqlCT96WhatcrT42ujFW4CSqTCj3CO+X32sVPzKjCt993Ij01OI 9st5WhJXVJdwfomlgG4U33u6rxs+oxi2aHnhMUgc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wen Yang , Peng Hao , Zhao Qiang , "David S. Miller" , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Sasha Levin 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 Message-Id: <20191122054911.1750-144-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Yang [ Upstream commit 40752b3eae29f8ca2378e978a02bd6dbeeb06d16 ] This patch fixes potential double frees if register_hdlc_device() fails. Signed-off-by: Wen Yang Reviewed-by: Peng Hao CC: Zhao Qiang CC: "David S. Miller" CC: netdev@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org CC: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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