mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info
commit 96562c45af upstream.
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: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dac14a1dbe
commit
fd9a8ad2cf
@@ -154,7 +154,7 @@ nfs4_get_device_info(struct nfs_server *server,
|
|||||||
set_bit(NFS_DEVICEID_NOCACHE, &d->flags);
|
set_bit(NFS_DEVICEID_NOCACHE, &d->flags);
|
||||||
|
|
||||||
out_free_pages:
|
out_free_pages:
|
||||||
for (i = 0; i < max_pages; i++)
|
while (--i >= 0)
|
||||||
__free_page(pages[i]);
|
__free_page(pages[i]);
|
||||||
kfree(pages);
|
kfree(pages);
|
||||||
out_free_pdev:
|
out_free_pdev:
|
||||||
|
|||||||
Reference in New Issue
Block a user