diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-02-17 13:32:03 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-02-19 09:13:25 +0100 |
commit | 26fe1f4c550dae06ae4af3299bbef6b9d78c4ba0 (patch) | |
tree | 637e6e2f05376127a69ed339f803e2a7e4b4a766 /drivers/gpu/drm/qxl/qxl_kms.c | |
parent | drm/tilcdc: fix raster control register setting (diff) | |
download | linux-26fe1f4c550dae06ae4af3299bbef6b9d78c4ba0.tar.xz linux-26fe1f4c550dae06ae4af3299bbef6b9d78c4ba0.zip |
drm/qxl: properly handle device init failures
Specifically do not try release resources which where
not allocated in the first place.
Cc: Tong Zhang <ztong0001@gmail.com>
Tested-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20210217123213.2199186-2-kraxel@redhat.com
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_kms.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index 66d74aaaee06..4dc5ad13f12c 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -288,6 +288,10 @@ void qxl_device_fini(struct qxl_device *qdev) { int cur_idx; + /* check if qxl_device_init() was successful (gc_work is initialized last) */ + if (!qdev->gc_work.func) + return; + for (cur_idx = 0; cur_idx < 3; cur_idx++) { if (!qdev->current_release_bo[cur_idx]) continue; |