[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMeQTsb1dBpd+87DDpNS5uyM8sTAhzZmxNvE_RLZFAC2dD2Lxg@mail.gmail.com>
Date: Fri, 19 Sep 2025 12:07:11 +0200
From: Patrik Jakobsson <patrik.r.jakobsson@...il.com>
To: Zabelin Nikita <n.zabelin@...integration.ru>
Cc: David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>, Dave Airlie <airlied@...hat.com>,
Alan Cox <alan@...ux.intel.com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: Re: [PATCH] drm/gma500: Fix null dereference in hdmi teardown
On Thu, Sep 18, 2025 at 5:08 PM Zabelin Nikita
<n.zabelin@...integration.ru> wrote:
>
> pci_set_drvdata sets the value of pdev->driver_data to NULL,
> after which the driver_data obtained from the same dev is
> dereferenced in oaktrail_hdmi_i2c_exit, and the i2c_dev is
> extracted from it. To prevent this, swap these calls.
>
> Fixes: 1b082cc ("gma500: Add Oaktrail support")
>
> Found by Linux Verification Center (linuxtesting.org) with Svacer.
>
> Signed-off-by: Zabelin Nikita <n.zabelin@...integration.ru>
Thanks for the patch.
I fixed the following DIM warning before applying:
WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12+
chars of sha1> ("<title line>")' - ie: 'Fixes: 1b082ccf5901 ("gma500:
Add Oaktrail support")'
Pushed to drm-misc-fixes
-Patrik
> ---
> drivers/gpu/drm/gma500/oaktrail_hdmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 95b7cb099e63..9c7d9584aac7 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -724,8 +724,8 @@ void oaktrail_hdmi_teardown(struct drm_device *dev)
>
> if (hdmi_dev) {
> pdev = hdmi_dev->dev;
> - pci_set_drvdata(pdev, NULL);
> oaktrail_hdmi_i2c_exit(pdev);
> + pci_set_drvdata(pdev, NULL);
> iounmap(hdmi_dev->regs);
> kfree(hdmi_dev);
> pci_dev_put(pdev);
> --
> 2.43.0
>
Powered by blists - more mailing lists