lkml.org 
[lkml]   [2019]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 66/79] net: seeq: Fix the function used to release some memory in an error handling path
    Date
    From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

    [ 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 <christophe.jaillet@wanadoo.fr>
    Reviewed-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 696037d5ac3d5..ad557f457b2ce 100644
    --- a/drivers/net/ethernet/seeq/sgiseeq.c
    +++ b/drivers/net/ethernet/seeq/sgiseeq.c
    @@ -793,15 +793,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


    \
     
     \ /
      Last update: 2019-09-20 00:32    [W:4.048 / U:0.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site