Message ID | 20221110111939.135696-1-liujian56@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | cifs: use kfree in error path of cifs_writedata_alloc() | expand |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index cd9698209930..9a250fee673f 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2440,7 +2440,7 @@ cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete) if (pages) { writedata = cifs_writedata_direct_alloc(pages, complete); if (!writedata) - kvfree(pages); + kfree(pages); } return writedata;
'pages' is allocated by kcalloc(), which should freed by kfree(). Fixes: 4153d789e299 ("cifs: Fix pages array leak when writedata alloc failed in cifs_writedata_alloc()") Signed-off-by: Liu Jian <liujian56@huawei.com> --- fs/cifs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)