Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876404pjb; Mon, 27 Jul 2020 07:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfL/QVMp903tv+WpJn6onlGtZq4zKLN/p1D2o1Rk6wCDmeSSWRjaiAA/KE2FFQM1bgaGP2 X-Received: by 2002:a17:907:11dd:: with SMTP id va29mr20252257ejb.470.1595859798410; Mon, 27 Jul 2020 07:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859798; cv=none; d=google.com; s=arc-20160816; b=nRALHCQkJcuZVLZ5eE0HbmdMZYzmjYrzQxZuygEbfvnJGf4HVHgD+n+DLR8CnsHbWb ADyucDBUvuSH1CNX1+KNCOW33fPEku/AaWw6YDcQxtIUjli9mKiaf9CuPv7ggU0rlRUu Uu+hVMKu4HTbpXJBE3kayDxAAoxG+yiARTm+EROhJ6yokONCmRf8xLmkjl1opAtpCFlc k+ROeI1IvTcDCQwmIB0XI33aXErvnPy2+svi5wHlK+QPwMMTYO3JSiVQ5V0AyJjsdcF9 xdYNrRRVqXZG7jIAPwMdGCYU1mMiI8sw8r1FDT6KR/E9kKA6uFU/H7hzn1DtowhrrUct Twiw== 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=2mDuc3JRwnkipOluBUaGuNm8s4MyJIYEdgZBTJcZVjw=; b=ZIqsz+VnUjJL3E3m7T2Wh1wDZY+QljA5zsk/QvJKQTX2Mz4A4BrRrf/mNQw3VbSc2L IA4jqX8e8W3G0G6GroushvkbNUmizAznn9KlkxCXmnEk1MaYCNgeTTH90Hk+DFBib2mM OH9qHK7zOFD6LbOR6FMrHU+Hb4d7SNtaVl2U4zSEitPlhkeUEVVKVF/7GWJJqsJh5JWi KQECjChs6T3W/7WL+7/Z04OkYiiJ+z54kfAW+fonwYZFnbjqdnAghRLAmzH+2RUs6uUY /w0W+7yvJ9O/8++84eDCcAwHaxmD3Ey37bbaeriIxNseusPa3adZkBGJkUh1r3SRVnnV MkRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xlyW9E9X; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si4223610edl.33.2020.07.27.07.22.55; Mon, 27 Jul 2020 07:23:18 -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=xlyW9E9X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731739AbgG0OVf (ORCPT + 99 others); Mon, 27 Jul 2020 10:21:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731728AbgG0OVa (ORCPT ); Mon, 27 Jul 2020 10:21:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 E13B52070A; Mon, 27 Jul 2020 14:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859690; bh=h1XxfQffSdng9jG/pVznLTCz6+7NXwQpLZd95y/eJKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xlyW9E9XeVtcupysc2rmkd+8IaqufcTz3QDNvx3+1hTpkSWoyN/GZtoRj8/rHePvG uMGv5QcN9tVKqthSvhRRmKhiqEQi5TGf6A65W/tbHAD+OckgFqyt3RjnXQN0/5v/HP wcPAdDBF15xZ7b5sIaX5H8f1vfPzFpsmS9hKbP5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Jian , Madalin Bucur , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 068/179] dpaa_eth: Fix one possible memleak in dpaa_eth_probe Date: Mon, 27 Jul 2020 16:04:03 +0200 Message-Id: <20200727134935.981834348@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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: Liu Jian [ Upstream commit 6790711f8ac5faabc43237c0d05d93db431a1ecc ] When dma_coerce_mask_and_coherent() fails, the alloced netdev need to be freed. Fixes: 060ad66f9795 ("dpaa_eth: change DMA device") Signed-off-by: Liu Jian Acked-by: Madalin Bucur Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 6bfa7575af942..5f82c1f32f09b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) DMA_BIT_MASK(40)); if (err) { netdev_err(net_dev, "dma_coerce_mask_and_coherent() failed\n"); - return err; + goto free_netdev; } /* If fsl_fm_max_frm is set to a higher value than the all-common 1500, -- 2.25.1