mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
ipmi: Fix leak in __ipmi_bmc_register
In case that ida_alloc(&ipmi_bmc_ida,...) succeeds and then platform_device_register() fails, ipmi_bmc_ida is leaked. Fix by freeing the error path Signed-off-by: Michail Tatas <michail.tatas@gmail.com> Message-ID: <anUK_HOy_pCgvsBm@michalis-linux> Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
parent
b6c46ab0bd
commit
18e633dd96
|
|
@ -3301,6 +3301,7 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf,
|
|||
list_del(&intf->bmc_link);
|
||||
mutex_unlock(&bmc->dyn_mutex);
|
||||
intf->bmc = &intf->tmp_bmc;
|
||||
ida_free(&ipmi_bmc_ida, bmc->pdev.id);
|
||||
put_device(&bmc->pdev.dev);
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user