Skip to content

Commit 61d8cdb

Browse files
committed
accel/qaic: Fix NULL pointer deref in qaic_destroy_drm_device()
If qaic_destroy_drm_device() is called before the device has fully initialized it will cause a NULL pointer dereference as the drm device has not yet been created. Fix this with a NULL check. Fixes: c501ca2 ("accel/qaic: Add uapi and core driver file") Signed-off-by: Jeffrey Hugo <[email protected]> Reviewed-by: Carl Vanderlip <[email protected]> Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3e1b9b2 commit 61d8cdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/accel/qaic/qaic_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id)
225225
struct qaic_user *usr;
226226

227227
qddev = qdev->qddev;
228+
qdev->qddev = NULL;
229+
if (!qddev)
230+
return;
228231

229232
/*
230233
* Existing users get unresolvable errors till they close FDs.

0 commit comments

Comments
 (0)