lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <48f68940-14a4-6ea7-4296-53970cd74015@huawei.com>
Date:   Mon, 2 Nov 2020 17:06:43 +0800
From:   "tiantao (H)" <tiantao6@...wei.com>
To:     Thomas Zimmermann <tzimmermann@...e.de>,
        Tian Tao <tiantao6@...ilicon.com>, <airlied@...ux.ie>,
        <daniel@...ll.ch>, <kraxel@...hat.com>,
        <alexander.deucher@....com>, <tglx@...utronix.de>,
        <dri-devel@...ts.freedesktop.org>, <xinliang.liu@...aro.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/hisilicon: Remove redundant null check



在 2020/11/2 17:03, Thomas Zimmermann 写道:
> Hi
> 
> Am 02.11.20 um 09:46 schrieb tiantao (H):
>>
>>
>> 在 2020/11/2 16:32, Thomas Zimmermann 写道:
>>> Hi
>>>
>>> Am 30.10.20 um 10:27 schrieb Tian Tao:
>>>> drm_irq_uninstall can handle the case where dev->irq_enable is false,
>>>> so Remove redundant null check.
>>>>
>>>> Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
>>>> ---
>>>>    drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 +++---
>>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>>>> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>>>> index 0c1b40d..b71589b1 100644
>>>> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>>>> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>>>> @@ -246,13 +246,13 @@ static int hibmc_unload(struct drm_device *dev)
>>>>          drm_atomic_helper_shutdown(dev);
>>>>    -    if (dev->irq_enabled)
>>>> -        drm_irq_uninstall(dev);
>>>> -
>>>> +    drm_irq_uninstall(dev);
>>>
>>> Removing this check would at least result in an error, [1] so rather
>>> leave it in for now.
>>>
>> Now there seems to be no driver to check the return value of
>> drm_irq_uninstall
> 
> True. No clean-up code should ever fail. But currently, it's not handled
> by drm_irq_uninstall().
> 
> A better fix would be to have drm_irq_uninstall() return early with a
> warning if IRQs are disabled. And for most drivers, a managed version of
> drm_irq_install() would be useful.
> 
Codes like the following
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 09d6e9e..572357c 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -172,6 +172,9 @@ int drm_irq_uninstall(struct drm_device *dev)
         bool irq_enabled;
         int i;

+       if(!dev->irq_enabled || !dev)
+               return 0;
> Best regards
> Thomas
> 
>>> Instead, we could discuss if drm_irq_install() should become a managed
>>> interface.
>>
>> Codes like the following
>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>> index 09d6e9e..572357c 100644
>> --- a/drivers/gpu/drm/drm_irq.c
>> +++ b/drivers/gpu/drm/drm_irq.c
>> @@ -172,6 +172,9 @@ int drm_irq_uninstall(struct drm_device *dev)
>>          bool irq_enabled;
>>          int i;
>>
>> +       if(!dev->irq_enabled || !dev)
>> +               return 0;
>>
>>>
>>> Best regards
>>> Thomas
>>>
>>> [1]
>>> https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_irq.c#L201
>>>
>>>
>>>>        pci_disable_msi(dev->pdev);
>>>> +
>>>>        hibmc_kms_fini(priv);
>>>>        hibmc_mm_fini(priv);
>>>>        dev->dev_private = NULL;
>>>> +
>>>>        return 0;
>>>>    }
>>>>   
>>>
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ