diff options
| author | Colin Ian King <colin.king@canonical.com> | 2017-05-17 14:24:15 -0400 |
|---|---|---|
| committer | Steve French <smfrench@gmail.com> | 2017-06-20 20:11:35 -0400 |
| commit | ecf3411a121e7a653e309ff50a820ffa87c537f8 (patch) | |
| tree | c76212d915c9751d44386dcbb47c78bb182a35fb /fs | |
| parent | 8a7b0d8e8d9962ec3b2ae64dd4e86d68a6fb9220 (diff) | |
CIFS: check if pages is null rather than bv for a failed allocation
pages is being allocated however a null check on bv is being used
to see if the allocation failed. Fix this by checking if pages is
null.
Detected by CoverityScan, CID#1432974 ("Logically dead code")
Fixes: ccf7f4088af2dd ("CIFS: Add asynchronous context to support kernel AIO")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/cifs/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index b08531977daa..3b147dc6af63 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -810,7 +810,7 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw) | |||
| 810 | 810 | ||
| 811 | if (!pages) { | 811 | if (!pages) { |
| 812 | pages = vmalloc(max_pages * sizeof(struct page *)); | 812 | pages = vmalloc(max_pages * sizeof(struct page *)); |
| 813 | if (!bv) { | 813 | if (!pages) { |
| 814 | kvfree(bv); | 814 | kvfree(bv); |
| 815 | return -ENOMEM; | 815 | return -ENOMEM; |
| 816 | } | 816 | } |
