From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Ma Ke <make24@iscas.ac.cn>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
daniel@ffwll.ch, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH] drm: omapdrm: Add missing check for alloc_ordered_workqueue
Date: Thu, 8 Aug 2024 13:47:13 +0300 [thread overview]
Message-ID: <2d87f6dc-41c4-4642-a672-2fd5ab7927c6@ideasonboard.com> (raw)
In-Reply-To: <20240808061336.2796729-1-make24@iscas.ac.cn>
On 08/08/2024 09:13, Ma Ke wrote:
> As it may return NULL pointer and cause NULL pointer dereference. Add check
> for the return value of alloc_ordered_workqueue.
>
> Cc: stable@vger.kernel.org
> Fixes: 2f95bc6d324a ("drm: omapdrm: Perform initialization/cleanup at probe/remove time")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> drivers/gpu/drm/omapdrm/omap_drv.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 6598c9c08ba1..94a57f0d1c08 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -695,6 +695,10 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
> soc = soc_device_match(omapdrm_soc_devices);
> priv->omaprev = soc ? (uintptr_t)soc->data : 0;
> priv->wq = alloc_ordered_workqueue("omapdrm", 0);
> + if (!priv->wq) {
> + ret = -ENOMEM;
> + goto err_alloc_workqueue;
> + }
>
> mutex_init(&priv->list_lock);
> INIT_LIST_HEAD(&priv->obj_list);
> @@ -753,6 +757,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
> drm_mode_config_cleanup(ddev);
> omap_gem_deinit(ddev);
> destroy_workqueue(priv->wq);
> +err_alloc_workqueue:
> omap_disconnect_pipelines(ddev);
> drm_dev_put(ddev);
> return ret;
Thanks, I'll pick this up to drm-misc.
Tomi
prev parent reply other threads:[~2024-08-08 10:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 6:13 Ma Ke
2024-08-08 10:47 ` Tomi Valkeinen [this message]
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=2d87f6dc-41c4-4642-a672-2fd5ab7927c6@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=make24@iscas.ac.cn \
--cc=mripard@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®