NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info
authorFedor Pchelkin <pchelkin@ispras.ru>
Thu, 20 Jul 2023 15:37:51 +0000 (18:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:27:58 +0000 (12:27 +0200)
commitfd9a8ad2cfa74c648b3ecb547ea931027770978b
tree0e678e81bdadf4dcaf1d2c2c53e322f58c2f788f
parentdac14a1dbe20e003215dacb8a3a1a7e4ca4e0ad0
NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info

commit 96562c45af5c31b89a197af28f79bfa838fb8391 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>
fs/nfs/pnfs_dev.c