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: ccf7f4088a ("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>
This commit is contained in:
Colin Ian King 2017-05-17 19:24:15 +01:00 коммит произвёл Steve French
Родитель 8a7b0d8e8d
Коммит ecf3411a12
1 изменённых файлов: 1 добавлений и 1 удалений
fs/cifs

Просмотреть файл

@ -810,7 +810,7 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
if (!pages) { if (!pages) {
pages = vmalloc(max_pages * sizeof(struct page *)); pages = vmalloc(max_pages * sizeof(struct page *));
if (!bv) { if (!pages) {
kvfree(bv); kvfree(bv);
return -ENOMEM; return -ENOMEM;
} }