提交 c0a32fe1 编写于 作者: C Colin Ian King 提交者: Corey Minyard

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: 7e030d6d ("ipmi: Prefer ACPI system interfaces over SMBIOS ones")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NCorey Minyard <cminyard@mvista.com>
上级 b79bba15
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册