All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Stephen Boyd <swboyd@chromium.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org
Subject: [PATCH v6 1/4] drm/msm: clean event_thread->worker in case of an error
Date: Sat, 18 Jun 2022 02:33:25 +0300	[thread overview]
Message-ID: <20220617233328.1143665-2-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20220617233328.1143665-1-dmitry.baryshkov@linaro.org>

If worker creation fails, nullify the event_thread->worker, so that
msm_drm_uninit() doesn't try accessing invalid memory location. While we
are at it, remove duplicate assignment to the ret variable.

Fixes: 1041dee2178f ("drm/msm: use kthread_create_worker instead of kthread_run")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 44485363f37a..1aab6bf86278 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -436,7 +436,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 		if (IS_ERR(priv->event_thread[i].worker)) {
 			ret = PTR_ERR(priv->event_thread[i].worker);
 			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
-			ret = PTR_ERR(priv->event_thread[i].worker);
+			priv->event_thread[i].worker = NULL;
 			goto err_msm_uninit;
 		}
 
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Stephen Boyd <swboyd@chromium.org>,
	freedreno@lists.freedesktop.org
Subject: [PATCH v6 1/4] drm/msm: clean event_thread->worker in case of an error
Date: Sat, 18 Jun 2022 02:33:25 +0300	[thread overview]
Message-ID: <20220617233328.1143665-2-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20220617233328.1143665-1-dmitry.baryshkov@linaro.org>

If worker creation fails, nullify the event_thread->worker, so that
msm_drm_uninit() doesn't try accessing invalid memory location. While we
are at it, remove duplicate assignment to the ret variable.

Fixes: 1041dee2178f ("drm/msm: use kthread_create_worker instead of kthread_run")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 44485363f37a..1aab6bf86278 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -436,7 +436,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 		if (IS_ERR(priv->event_thread[i].worker)) {
 			ret = PTR_ERR(priv->event_thread[i].worker);
 			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
-			ret = PTR_ERR(priv->event_thread[i].worker);
+			priv->event_thread[i].worker = NULL;
 			goto err_msm_uninit;
 		}
 
-- 
2.35.1


  reply	other threads:[~2022-06-17 23:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 23:33 [PATCH v6 0/4] drm/msm: convet to drm_crtc_handle_vblank() Dmitry Baryshkov
2022-06-17 23:33 ` Dmitry Baryshkov
2022-06-17 23:33 ` Dmitry Baryshkov [this message]
2022-06-17 23:33   ` [PATCH v6 1/4] drm/msm: clean event_thread->worker in case of an error Dmitry Baryshkov
2022-09-08  0:08   ` Abhinav Kumar
2022-09-08  0:08     ` Abhinav Kumar
2022-09-08 14:47     ` Dmitry Baryshkov
2022-09-08 14:47       ` Dmitry Baryshkov
2022-06-17 23:33 ` [PATCH v6 2/4] drm/msm/mdp4: convert to drm_crtc_handle_vblank() Dmitry Baryshkov
2022-06-17 23:33   ` Dmitry Baryshkov
2022-06-17 23:33 ` [PATCH v6 3/4] drm/msm/mdp5: " Dmitry Baryshkov
2022-06-17 23:33   ` Dmitry Baryshkov
2022-06-17 23:33 ` [PATCH v6 4/4] drm/msm: stop storing the array of CRTCs in struct msm_drm_private Dmitry Baryshkov
2022-06-17 23:33   ` Dmitry Baryshkov
2023-01-25  2:14   ` Abhinav Kumar
2023-01-25  2:14     ` Abhinav Kumar
2023-01-25  7:29     ` Dmitry Baryshkov
2023-01-25  7:29       ` Dmitry Baryshkov
2023-01-25 19:16       ` Abhinav Kumar
2023-01-25 19:16         ` Abhinav Kumar
2023-01-09 22:41 ` [PATCH v6 0/4] drm/msm: convet to drm_crtc_handle_vblank() Dmitry Baryshkov
2023-01-09 23:43   ` Dmitry Baryshkov
2023-01-09 23:43   ` Dmitry Baryshkov
2023-01-09 22:41   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617233328.1143665-2-dmitry.baryshkov@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.