samples: vfio-mdev: fix error handing in mdpy_fb_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 20 May 2021 13:36:41 +0000 (13:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:39:15 +0000 (13:39 +0200)
commit2adb0313b132cdade0827820f1d0db4833dfb4ef
treea62a9d8597c250fa15d765265e192081a928b7b3
parentc25454a4f4cbb172c47a6a49506de8ab133928a1
samples: vfio-mdev: fix error handing in mdpy_fb_probe()

[ Upstream commit 752774ce7793a1f8baa55aae31f3b4caac49cbe4 ]

Fix to return a negative error code from the framebuffer_alloc() error
handling case instead of 0, also release regions in some error handing
cases.

Fixes: cacade1946a4 ("sample: vfio mdev display - guest driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Message-Id: <20210520133641.1421378-1-weiyongjun1@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
samples/vfio-mdev/mdpy-fb.c