We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 247f34f commit 4153d78Copy full SHA for 4153d78
fs/cifs/file.c
@@ -2434,12 +2434,16 @@ cifs_writev_complete(struct work_struct *work)
2434
struct cifs_writedata *
2435
cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete)
2436
{
2437
+ struct cifs_writedata *writedata = NULL;
2438
struct page **pages =
2439
kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
- if (pages)
2440
- return cifs_writedata_direct_alloc(pages, complete);
+ if (pages) {
2441
+ writedata = cifs_writedata_direct_alloc(pages, complete);
2442
+ if (!writedata)
2443
+ kvfree(pages);
2444
+ }
2445
- return NULL;
2446
+ return writedata;
2447
}
2448
2449
0 commit comments