Commit 96562c45 authored by Fedor Pchelkin's avatar Fedor Pchelkin Committed by Anna Schumaker
Browse files

NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info



It is an almost improbable error case but when page allocating loop in
nfs4_get_device_info() fails then we should only free the already
allocated pages, as __free_page() can't deal with NULL arguments.

Found by Linux Verification Center (linuxtesting.org).

Cc: stable@vger.kernel.org
Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 08be82ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ nfs4_get_device_info(struct nfs_server *server,
		set_bit(NFS_DEVICEID_NOCACHE, &d->flags);

out_free_pages:
	for (i = 0; i < max_pages; i++)
	while (--i >= 0)
		__free_page(pages[i]);
	kfree(pages);
out_free_pdev: