mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Zheng Wang <zyytlz.wz@163.com>, dri-devel@lists.freedesktop.org
Cc: andrzej.hajda@intel.com, jonas@kwiboo.se, airlied@gmail.com,
	daniel@ffwll.ch, linux-kernel@vger.kernel.org,
	hackerzheng666@gmail.com, 1395428693sheep@gmail.com,
	alex000young@gmail.com
Subject: Re: [PATCH] drm/bridge: adv7511: fix race condition bug in adv7511_remove due to unfinished work
Date: Wed, 15 Mar 2023 10:08:21 +0100	[thread overview]
Message-ID: <d1eee7a0-8942-5f76-a3f0-74dcfddb95b5@linaro.org> (raw)
In-Reply-To: <20230308173433.2788833-1-zyytlz.wz@163.com>

Hi,

On 08/03/2023 18:34, Zheng Wang wrote:
> In adv7511_probe, adv7511->hpd_work is bound with adv7511_hpd_work.
> If we call adv7511_remove with a unfinished work. There may be a
> race condition where bridge->hpd_mutex was destroyed by
> drm_bridge_remove and used in adv7511_hpd_work in drm_bridge_hpd_notify.
> 
> Fix it by canceling the work before cleanup in adv7511_remove.
> 

Can you add the relevant Fixes tag ?

Thanks,
Neil

> Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
> ---
>   drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index ddceafa7b637..9bf72dd6c1d3 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1349,6 +1349,7 @@ static void adv7511_remove(struct i2c_client *i2c)
>   {
>   	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
>   
> +	cancel_work_sync(&adv7511->hpd_work);
>   	adv7511_uninit_regulators(adv7511);
>   
>   	drm_bridge_remove(&adv7511->bridge);


  reply	other threads:[~2023-03-15  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 17:34 Zheng Wang
2023-03-15  9:08 ` neil.armstrong [this message]
2023-03-15  9:20   ` Zheng Hacker

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=d1eee7a0-8942-5f76-a3f0-74dcfddb95b5@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=1395428693sheep@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alex000young@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hackerzheng666@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zyytlz.wz@163.com \
    /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®