[PATCH OLK-5.10] Fix kfree mismatch reported by cocci

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNI18 CVE: NA -------------------------------- fs/cifs/cifssmb.c: warning: kfree_mismatch.cocci ./fs/cifs/cifssmb.c:2129:15-16: WARNING kmalloc is used to allocate this memory at line 2125 kcalloc() ends up using kmalloc() to allocate memory, so use kfree() instead of kvfree() to free memory. Fixes: 95621e78c9bf ("cifs: Fix pages leak when cifs_writedata allocate fails in cifs_writedata_direct_alloc()") Signed-off-by: Wang Zhaolong <wangzhaolong1@huawei.com> --- fs/cifs/cifssmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 1a6c9ac25615..643729b498a0 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2126,7 +2126,7 @@ cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete) if (pages) { wdata = cifs_writedata_direct_alloc(pages, complete); if (!wdata) - kvfree(pages); + kfree(pages); } return wdata; -- 2.34.3

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/15216 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/NXO... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/15216 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/NXO...
participants (2)
-
patchwork bot
-
Wang Zhaolong