diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-05-15 22:09:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-30 14:38:36 +0300 |
commit | 11c0ed097a874156957b515d0ba7e356142eab87 (patch) | |
tree | 77cd648072d101a4fd9184e50dc789a5c96ea670 /drivers/net/ethernet/sun/cassini.c | |
parent | 2f88c8d38ecf5ed0273f99a067246899ba499eb2 (diff) | |
download | linux-11c0ed097a874156957b515d0ba7e356142eab87.tar.xz |
cassini: Fix a memory leak in the error handling path of cas_init_one()
[ Upstream commit 412cd77a2c24b191c65ea53025222418db09817c ]
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@wanadoo.fr>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sun/cassini.c')
-rw-r--r-- | drivers/net/ethernet/sun/cassini.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c index 7e5c0f182770..ba546f993fb5 100644 --- a/drivers/net/ethernet/sun/cassini.c +++ b/drivers/net/ethernet/sun/cassini.c @@ -5152,6 +5152,8 @@ err_out_iounmap: cas_shutdown(cp); mutex_unlock(&cp->pm_mutex); + vfree(cp->fw_data); + pci_iounmap(pdev, cp->regs); |