]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers/virt/fsl_hypervisor: Fix error handling path
authorSouptick Joarder <jrdr.linux@gmail.com>
Tue, 1 Sep 2020 21:21:11 +0000 (02:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:35 +0000 (10:07 +0100)
commitc7072eda40939b5b854aa1074bd5703c1d4fe96a
tree384abe404bc442ab39f948002af62b85579fb34a
parent38b31913322614709f6a9a5f6c80f1fbc35e8314
drivers/virt/fsl_hypervisor: Fix error handling path

[ Upstream commit 7f360bec37857bfd5a48cef21d86f58a09a3df63 ]

First, when memory allocation for sg_list_unaligned failed, there
is a bug of calling put_pages() as we haven't pinned any pages.

Second, if get_user_pages_fast() failed we should unpin num_pinned
pages.

This will address both.

As part of these changes, minor update in documentation.

Fixes: 6db7199407ca ("drivers/virt: introduce Freescale hypervisor management driver")
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Link: https://lore.kernel.org/r/1598995271-6755-1-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/virt/fsl_hypervisor.c