Skip to content

Commit

Permalink
drm/msm: fix missing wq allocation error handling
Browse files Browse the repository at this point in the history
[ Upstream commit ca090c8 ]

Add the missing sanity check to handle workqueue allocation failures.

Fixes: c8afe68 ("drm/msm: basic KMS driver for snapdragon")
Cc: stable@vger.kernel.org      # 3.12
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/525102/
Link: https://lore.kernel.org/r/20230306100722.28485-8-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jhovold authored and gregkh committed May 17, 2023
1 parent 46062a1 commit c5111be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/msm/msm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c5111be

Please sign in to comment.