Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] cifs: use kfree in error path of cifs_writedata_alloc()
@ 2022-11-10 11:19 Liu Jian
  2022-11-10 20:30 ` Fwd: " Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Jian @ 2022-11-10 11:19 UTC (permalink / raw)
  To: sfrench, pc, lsahlber, sprasad, tom, zhangxiaoxu5, linux-cifs,
	samba-technical
  Cc: liujian56

'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(-)

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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-10 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10 11:19 [PATCH] cifs: use kfree in error path of cifs_writedata_alloc() Liu Jian
2022-11-10 20:30 ` Fwd: " Steve French
2022-11-10 22:13   ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox