From: Yongbang Shi <shiyongbang@huawei.com>
To: oushixiong <oushixiong1025@163.com>, <xinliang.liu@linaro.org>,
<tiantao6@hisilicon.com>, <maarten.lankhorst@linux.intel.com>,
<mripard@kernel.org>, <tzimmermann@suse.de>, <airlied@gmail.com>,
<daniel@ffwll.ch>, <kong.kongxinwei@hisilicon.com>
Cc: <liangjian010@huawei.com>, <chenjianmin@huawei.com>,
<lidongming5@huawei.com>, <libaihan@huawei.com>,
<shenjian15@huawei.com>, <shaojijie@huawei.com>,
<jani.nikula@linux.intel.com>,
<dmitry.baryshkov@oss.qualcomm.com>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH drm-dp 04/10] drm/hisilicon/hibmc: fix the hibmc loaded failed bug
Date: Fri, 6 Jun 2025 16:20:38 +0800 [thread overview]
Message-ID: <b6b30bdd-7562-4435-a267-2bdafb0dc359@huawei.com> (raw)
In-Reply-To: <b0587eda-df65-4abc-b2af-c5dcb717c8b6@163.com>
>
>> From: Baihan Li<libaihan@huawei.com>
>>
>> When hibmc loaded failed, the driver use hibmc_unload to free the
>> resource, but the mutexes in mode.config are not init, which will
>> access an NULL pointer.
>>
>> Fixes: b3df5e65cc03 ("drm/hibmc: Drop drm_vblank_cleanup")
>> Reported-by:oushixiong1025@163.com
>> Signed-off-by: Baihan Li<libaihan@huawei.com>
>> ---
>> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> index 4cdcc34070ee..ac552c339671 100644
>> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> @@ -319,13 +319,13 @@ static int hibmc_load(struct drm_device *dev)
>>
>> ret = hibmc_hw_init(priv);
>> if (ret)
>> - goto err;
>> + return ret;
>>
>> ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
>> pci_resource_len(pdev, 0));
>> if (ret) {
>> drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
>> - goto err;
>> + return ret;
>
> The mutexes in mode.config are initialized when calling hibmc_kms_init(),
> if calling hibmc_kms_init() failed it also need to return.
>
> You may want to look at the following patch:
> LKML: oushixiong1025@163 ...: [PATCH] drm/hisilicon: Fix a NULL
> pointer access when hibmc_load failed
> <https://lkml.org/lkml/2025/5/20/331>
>
> Reported-by: Shixiong Ou <oushixiong@kylinos.cn>
>
> Thanks and Regards,
> Shixiong Ou.
>
Hi Shixiong,
Thanks for your advice!
Actually, even if the calling of drmm_mode_config_init() failed, these mutexes are still initialized,
and it's the same for hibmc_kms_init() failed, so we don't need to change its return.
Thanks,
Baihan Li
>> }
>>
>> ret = hibmc_kms_init(priv);
next prev parent reply other threads:[~2025-06-06 8:39 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 9:54 [PATCH drm-dp 00/10] Fix hibmc driver bugs Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 01/10] drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init failed Yongbang Shi
2025-06-08 11:20 ` Dmitry Baryshkov
2025-06-09 14:45 ` Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 02/10] drm/hisilicon/hibmc: fix dp probabilistical detect errors after HPD irq Yongbang Shi
2025-06-08 11:37 ` Dmitry Baryshkov
2025-06-09 14:47 ` Yongbang Shi
2025-06-09 14:49 ` Dmitry Baryshkov
2025-06-10 13:26 ` Yongbang Shi
2025-06-09 16:57 ` Dmitry Baryshkov
2025-05-30 9:54 ` [PATCH drm-dp 03/10] drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local Yongbang Shi
2025-06-08 11:43 ` Dmitry Baryshkov
2025-06-09 14:50 ` Yongbang Shi
2025-06-09 14:53 ` Dmitry Baryshkov
2025-06-10 13:28 ` Yongbang Shi
2025-06-16 9:27 ` Zenghui Yu
2025-05-30 9:54 ` [PATCH drm-dp 04/10] drm/hisilicon/hibmc: fix the hibmc loaded failed bug Yongbang Shi
[not found] ` <b0587eda-df65-4abc-b2af-c5dcb717c8b6@163.com>
2025-06-06 8:20 ` Yongbang Shi [this message]
2025-05-30 9:54 ` [PATCH drm-dp 05/10] drm/hisilicon/hibmc: fix rare monitors cannot display problem Yongbang Shi
2025-06-08 12:36 ` Dmitry Baryshkov
2025-06-09 14:56 ` Yongbang Shi
2025-06-09 18:53 ` Dmitry Baryshkov
2025-05-30 9:54 ` [PATCH drm-dp 06/10] drm/hisilicon/hibmc: add dp mode valid check Yongbang Shi
2025-06-08 12:39 ` Dmitry Baryshkov
2025-06-09 14:57 ` Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 07/10] drm/hisilicon/hibmc: add dp encoder modeset Yongbang Shi
2025-06-08 12:41 ` Dmitry Baryshkov
2025-06-10 13:30 ` Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 08/10] drm/hisilicon/hibmc: fix DP no showing after HPD with VGA connected Yongbang Shi
2025-06-08 12:44 ` Dmitry Baryshkov
2025-06-10 13:31 ` Yongbang Shi
2025-06-10 14:03 ` Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 09/10] drm/hisilicon/hibmc: fix HPD no showing with VGA para of GRUB Yongbang Shi
2025-06-08 12:47 ` Dmitry Baryshkov
2025-06-11 12:54 ` Yongbang Shi
2025-05-30 9:54 ` [PATCH drm-dp 10/10] drm/hisilicon/hibmc: fix no showing problem with loading hibmc manually Yongbang Shi
2025-06-08 12:54 ` Dmitry Baryshkov
2025-06-11 12:52 ` Yongbang Shi
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=b6b30bdd-7562-4435-a267-2bdafb0dc359@huawei.com \
--to=shiyongbang@huawei.com \
--cc=airlied@gmail.com \
--cc=chenjianmin@huawei.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=kong.kongxinwei@hisilicon.com \
--cc=liangjian010@huawei.com \
--cc=libaihan@huawei.com \
--cc=lidongming5@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oushixiong1025@163.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=tiantao6@hisilicon.com \
--cc=tzimmermann@suse.de \
--cc=xinliang.liu@linaro.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 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®