mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
bnxt_en: Fix a possible memory leak in bnxt_ptp_init
[ Upstream commit deb8eb39164382f1f67ef8e8af9176baf5e10f2d ]
In bnxt_ptp_init(), when ptp_clock_register() fails, the driver is
not freeing the memory allocated for ptp_info->pin_config. Fix it
to unconditionally free ptp_info->pin_config in bnxt_ptp_free().
Fixes: caf3eedbcd ("bnxt_en: 1PPS support for 5750X family chips")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20251104005700.542174-3-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dd03780c29
commit
7ee2eb8575
@@ -917,9 +917,9 @@ static void bnxt_ptp_free(struct bnxt *bp)
|
||||
if (ptp->ptp_clock) {
|
||||
ptp_clock_unregister(ptp->ptp_clock);
|
||||
ptp->ptp_clock = NULL;
|
||||
kfree(ptp->ptp_info.pin_config);
|
||||
ptp->ptp_info.pin_config = NULL;
|
||||
}
|
||||
kfree(ptp->ptp_info.pin_config);
|
||||
ptp->ptp_info.pin_config = NULL;
|
||||
}
|
||||
|
||||
int bnxt_ptp_init(struct bnxt *bp)
|
||||
|
||||
Reference in New Issue
Block a user