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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALs4sv0KNuS43GygsV=r+YTNjc244UMeQKy+T-NGa9W922KE8Q@mail.gmail.com>
Date: Tue, 16 May 2023 13:08:43 +0530
From: Pavan Chebbi <pavan.chebbi@...adcom.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Jaswinder Singh <jaswinder@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>, 
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org, 
	netdev@...r.kernel.org
Subject: Re: [PATCH] cassini: Fix a memory leak in the error handling path of cas_init_one()

On Tue, May 16, 2023 at 12:39 AM Christophe JAILLET
<christophe.jaillet@...adoo.fr> wrote:
>
> cas_saturn_firmware_init() allocates some memory using vmalloc(). This
> memory is freed in the .remove() function but not it the error handling
> path of the probe.
>
> Add the missing vfree() to avoid a memory leak, should an error occur.
>
> Fixes: fcaa40669cd7 ("cassini: use request_firmware")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  drivers/net/ethernet/sun/cassini.c | 2 ++
>  1 file changed, 2 insertions(+)
>

Looks good to me, though patch could have "net" in the subject.
Reviewed-by: Pavan Chebbi <pavan.chebbi@...adcom.com>


> diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
> index 2d52f54ebb45..b317b9486455 100644
> --- a/drivers/net/ethernet/sun/cassini.c
> +++ b/drivers/net/ethernet/sun/cassini.c
> @@ -5073,6 +5073,8 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>                 cas_shutdown(cp);
>         mutex_unlock(&cp->pm_mutex);
>
> +       vfree(cp->fw_data);
> +
>         pci_iounmap(pdev, cp->regs);
>
>
> --
> 2.34.1
>
>

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists