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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 25337C4CEC4 for ; Thu, 19 Sep 2019 22:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E69F021D79 for ; Thu, 19 Sep 2019 22:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931831; bh=HQVLVihA9ng0KNu2loCHAgQaGkrPun9sOzN75JWuSiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zlzRHTSUyyY0XWFZeIZdYb0ez/A7DhkGIMGL6Pf+RULGQNQnz27PQpbBay/kEImBF RhVrvSReV5jVoQkhyLf9cxXACVhLMncQlmg8FYwO9pMcDGU8f23olA6WPBzBoQMUqd 4AzXVoO0Sbaemi7tkL4VkiLP1Q+dyofm4gNzzesw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404833AbfISWXn (ORCPT ); Thu, 19 Sep 2019 18:23:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407028AbfISWXm (ORCPT ); Thu, 19 Sep 2019 18:23:42 -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 218BB21924; Thu, 19 Sep 2019 22:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931821; bh=HQVLVihA9ng0KNu2loCHAgQaGkrPun9sOzN75JWuSiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KEMwyT8XlLltlJq2rEQCIM9WA7HdAUD8SmE31icCtlQH2yjPJgi9Fzy6sxIefAQz2 QkUHIsp2Rxln5tffVQT0ZaTGVJjffDDEATF3ZISOEbOM8XHQoE22HGIQymWC4drq+o LvC/8qHNhkMidUR4yBUuu2FEikzzpe0D3k6M21Fg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Thomas Bogendoerfer , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 51/56] net: seeq: Fix the function used to release some memory in an error handling path Date: Fri, 20 Sep 2019 00:04:32 +0200 Message-Id: <20190919214804.370721534@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214742.483643642@linuxfoundation.org> References: <20190919214742.483643642@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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