diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-10-17 17:54:52 +0200 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2017-10-17 22:50:12 +0200 |
commit | c0a32fe13cd323ca9420500b16fd69589c9ba91e (patch) | |
tree | b1162cfc4c7d8954ab09ee0ee3ef8da131aa25f9 /drivers/char | |
parent | ipmi: remove redundant initialization of bmc (diff) | |
download | linux-c0a32fe13cd323ca9420500b16fd69589c9ba91e.tar.xz linux-c0a32fe13cd323ca9420500b16fd69589c9ba91e.zip |
ipmi_si: fix memory leak on new_smi
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: 7e030d6dff71 ("ipmi: Prefer ACPI system interfaces over SMBIOS ones")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 55e0c42bee4d..4c16af64f73a 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2004,6 +2004,7 @@ int ipmi_si_add_smi(struct si_sm_io *io) ipmi_addr_src_to_str(new_smi->io.addr_source), si_to_str[new_smi->io.si_type]); rv = -EBUSY; + kfree(new_smi); goto out_err; } } |