aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <[email protected]>2023-03-06 11:07:19 +0100
committerDmitry Baryshkov <[email protected]>2023-04-06 20:29:39 +0300
commitca090c837b430752038b24e56dd182010d77f6f6 (patch)
tree252fe8874c8ffaf64c146ad14e752e8bb9cf4c45
parent60d476af96015891c7959f30838ae7a9749932bf (diff)
drm/msm: fix missing wq allocation error handling
Add the missing sanity check to handle workqueue allocation failures. Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon") Cc: [email protected] # 3.12 Cc: Rob Clark <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/525102/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 4d85ca0ba0c1..2a9a363afe50 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -433,6 +433,10 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
priv->dev = ddev;
priv->wq = alloc_ordered_workqueue("msm", 0);
+ if (!priv->wq) {
+ ret = -ENOMEM;
+ goto err_put_dev;
+ }
INIT_LIST_HEAD(&priv->objects);
mutex_init(&priv->obj_lock);