lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220307222411.34bde8e1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Mon, 7 Mar 2022 22:24:11 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     "David S. Miller" <davem@...emloft.net>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH] ethernet: sun: Fix an error handling path in
 happy_meal_pci_probe()

On Sun,  6 Mar 2022 17:39:10 +0100 Christophe JAILLET wrote:
> A dma_free_coherent() call is missing in the error handling path of the
> probe, as already done in the remove function.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> dma_alloc_coherent() uses '&pdev->dev' and the remove function
> 'hp->dma_dev'.
> This change is a copy&paste from the remove function, so I've left the
> latter. It is not important because on line 3017 we have
> "hp->dma_dev = &pdev->dev;" so both expression are the same.
> 
> 
> I've not been able to find a Fixes tag because of the renaming of
> function and files.
> However, it looks old (before 2008)

Looks like we got an identical fix from someone else a day earlier:

https://lore.kernel.org/all/1646492104-23040-1-git-send-email-zheyuma97@gmail.com/

> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index ad9029ae6848..348ed5412544 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -3146,7 +3146,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
>  	if (err) {
>  		printk(KERN_ERR "happymeal(PCI): Cannot register net device, "
>  		       "aborting.\n");
> -		goto err_out_iounmap;
> +		goto err_out_free_dma;
>  	}
>  
>  	pci_set_drvdata(pdev, hp);
> @@ -3179,6 +3179,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
>  
>  	return 0;
>  
> +err_out_free_dma:
> +	dma_free_coherent(hp->dma_dev, PAGE_SIZE,
> +			  hp->happy_block, hp->hblock_dvma);
> +
>  err_out_iounmap:
>  	iounmap(hp->gregs);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ