lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 818/917] litex_liteeth: Fix a double free in the remove function
    Date
    From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

    [ Upstream commit c45231a7668d6b632534f692b10592ea375b55b0 ]

    'netdev' is a managed resource allocated in the probe using
    'devm_alloc_etherdev()'.
    It must not be freed explicitly in the remove function.

    Fixes: ee7da21ac4c3 ("net: Add driver for LiteX's LiteETH network interface")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/litex/litex_liteeth.c | 1 -
    1 file changed, 1 deletion(-)

    diff --git a/drivers/net/ethernet/litex/litex_liteeth.c b/drivers/net/ethernet/litex/litex_liteeth.c
    index a9bdbf0dcfe1e..5bb1cc8a2ce13 100644
    --- a/drivers/net/ethernet/litex/litex_liteeth.c
    +++ b/drivers/net/ethernet/litex/litex_liteeth.c
    @@ -289,7 +289,6 @@ static int liteeth_remove(struct platform_device *pdev)
    struct net_device *netdev = platform_get_drvdata(pdev);

    unregister_netdev(netdev);
    - free_netdev(netdev);

    return 0;
    }
    --
    2.33.0


    \
     
     \ /
      Last update: 2021-11-16 01:40    [W:4.250 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site