]> git.itanic.dy.fi Git - linux-stable/commit
cassini: Fix a memory leak in the error handling path of cas_init_one()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 15 May 2023 19:09:11 +0000 (21:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:30:18 +0000 (17:30 +0100)
commitb8b1a667744741fa7807b09a12797a27f14f3fac
tree1f7f4c273e5b8d0bc9f2f1d6fa18140fbd547e34
parent0d20210a190f76db9ec35ee4e0fc77e6c7a148f5
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>
drivers/net/ethernet/sun/cassini.c