Commit c97e4107 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

ipmi_si: fix memory leak on new_smi


[ Upstream commit c0a32fe1 ]

The error exit path omits kfree'ing the allocated new_smi, causing a memory
leak.  Fix this by kfree'ing new_smi.

Detected by CoverityScan, CID#14582571 ("Resource Leak")

Fixes: 7e030d6d ("ipmi: Prefer ACPI system interfaces over SMBIOS ones")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2d81d0f
...@@ -3469,6 +3469,7 @@ static int add_smi(struct smi_info *new_smi) ...@@ -3469,6 +3469,7 @@ static int add_smi(struct smi_info *new_smi)
ipmi_addr_src_to_str(new_smi->addr_source), ipmi_addr_src_to_str(new_smi->addr_source),
si_to_str[new_smi->si_type]); si_to_str[new_smi->si_type]);
rv = -EBUSY; rv = -EBUSY;
kfree(new_smi);
goto out_err; goto out_err;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment