* [PATCH RESEND] virtio: fix error handling in virtio_gpu_object_shmem_init
@ 2022-07-26 13:33 Liu Zixian
0 siblings, 0 replies; only message in thread
From: Liu Zixian @ 2022-07-26 13:33 UTC (permalink / raw)
To: airlied, kraxel, gurchetansingh, olvaffe, daniel
Cc: linfeilong, chenhaixiang3, dri-devel, virtualization
The comment on drm_gem_shmem_get_sg_table have been corrected, see
https://lore.kernel.org/dri-devel/20220718015357.1722-1-liuzixian4@huawei.com/t/#u
Signed-off-by: chenhaixiang <chenhaixiang3@huawei.com>
Signed-off-by: Liu Zixian <liuzixian4@huawei.com>
---
drivers/gpu/drm/virtio/virtgpu_object.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index f293e6ad5..a3681b5c8 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -168,7 +168,8 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev,
* since virtio_gpu doesn't support dma-buf import from other devices.
*/
shmem->pages = drm_gem_shmem_get_sg_table(&bo->base);
- if (!shmem->pages) {
+ if (IS_ERR(shmem->pages)) {
+ shmem->pages = NULL;
drm_gem_shmem_unpin(&bo->base);
return -EINVAL;
}
--
2.33.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-26 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 13:33 [PATCH RESEND] virtio: fix error handling in virtio_gpu_object_shmem_init Liu Zixian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).