From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C58E9C3A5A8 for ; Wed, 4 Sep 2019 16:03:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9503C20820 for ; Wed, 4 Sep 2019 16:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567613019; bh=HQVLVihA9ng0KNu2loCHAgQaGkrPun9sOzN75JWuSiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=U2U1LNksLuV2wragLGUHkh7p7ZBHJcIy5FEGHcdc1wTxbYfMxaSdvJ1oIF8qnmyOZ pO4MPgxQiyDUNGCZ2Hv21AogHgDa3HGAK08tTzTsket7qN8ls78izxS8SshecU1C2U HQBkCF/GZU1dFqxLOf5RhXjfql5r1ByXwQdL7KTw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387722AbfIDQDi (ORCPT ); Wed, 4 Sep 2019 12:03:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731482AbfIDQDf (ORCPT ); Wed, 4 Sep 2019 12:03:35 -0400 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 6844B2070C; Wed, 4 Sep 2019 16:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567613014; bh=HQVLVihA9ng0KNu2loCHAgQaGkrPun9sOzN75JWuSiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cuAE4VhAr8GZgoWK3u33QHKo7D/K+LzaMaPBGvByGuNN5E8pUeMBG2/gmIsctWO60 YeLbo1HjIDCrdFtSUyKw4Gm3MTyKGbvaqn8Gq0FU0b0+WQeGqo7N8xn+N0kknOc1CK YfFKsVJ21SjWICT3trSZuLpZ0VKMVo3nO3aqT4F8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Thomas Bogendoerfer , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 20/20] net: seeq: Fix the function used to release some memory in an error handling path Date: Wed, 4 Sep 2019 12:03:03 -0400 Message-Id: <20190904160303.5062-20-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190904160303.5062-1-sashal@kernel.org> References: <20190904160303.5062-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Christophe JAILLET [ Upstream commit e1e54ec7fb55501c33b117c111cb0a045b8eded2 ] In commit 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv"), a call to 'get_zeroed_page()' has been turned into a call to 'dma_alloc_coherent()'. Only the remove function has been updated to turn the corresponding 'free_page()' into 'dma_free_attrs()'. The error hndling path of the probe function has not been updated. Fix it now. Rename the corresponding label to something more in line. Fixes: 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv") Signed-off-by: Christophe JAILLET Reviewed-by: Thomas Bogendoerfer Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/seeq/sgiseeq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c index ca73366057486..2e5f7bbd30bfa 100644 --- a/drivers/net/ethernet/seeq/sgiseeq.c +++ b/drivers/net/ethernet/seeq/sgiseeq.c @@ -792,15 +792,16 @@ static int sgiseeq_probe(struct platform_device *pdev) printk(KERN_ERR "Sgiseeq: Cannot register net device, " "aborting.\n"); err = -ENODEV; - goto err_out_free_page; + goto err_out_free_attrs; } printk(KERN_INFO "%s: %s %pM\n", dev->name, sgiseeqstr, dev->dev_addr); return 0; -err_out_free_page: - free_page((unsigned long) sp->srings); +err_out_free_attrs: + dma_free_attrs(&pdev->dev, sizeof(*sp->srings), sp->srings, + sp->srings_dma, DMA_ATTR_NON_CONSISTENT); err_out_free_dev: free_netdev(dev); -- 2.20.1