Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e20105d9 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

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: fcaa4066 ("cassini: use request_firmware")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e519a404
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5138,6 +5138,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);