accel/qaic: Fix NULL pointer deref in qaic_destroy_drm_device()
authorJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 2 Jun 2023 21:04:40 +0000 (15:04 -0600)
committerJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 9 Jun 2023 17:07:28 +0000 (11:07 -0600)
commit61d8cdb7872c82d8a4d5e5251b0010332c316a67
tree06132e7670ab11f7d8e8bade7eb172789eb388e1
parent3e1b9b2d81901b3ceeb5ec1f1b4c41cd1cff53ba
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: c501ca23a6a3 ("accel/qaic: Add uapi and core driver file")
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230602210440.8411-3-quic_jhugo@quicinc.com
drivers/accel/qaic/qaic_drv.c