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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa6270c5-46d7-4082-ab5a-9a850616b6fe@infradead.org>
Date:   Sun, 24 Sep 2023 21:25:29 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Matthew Brost <matthew.brost@...el.com>,
        "Dr. David Alan Gilbert" <dave@...blig.org>
Cc:     mgreer@...malcreek.com, krzysztof.kozlowski@...aro.org,
        linux-kernel@...r.kernel.org, airlied@...il.com,
        intel-gfx@...ts.freedesktop.org
Subject: Re: ERR_PTR(0) in a couple of places



On 9/24/23 21:18, Matthew Brost wrote:
> On Sun, Sep 24, 2023 at 12:41:07AM +0000, Dr. David Alan Gilbert wrote:
>> Hi,
>>   I randomly noticed there are a couple of places in the kernel that
>> do
>>    ERR_PTR(0);
>>
>> and thought that was odd - shouldn't those just be NULL's ?
>>
>> 1) i915
>>   drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c : 47
>>
>>     if (i <= 1)
>>       return ERR_PTR(0);
> 
> Yes, s/ERR_PTR(0)/ERR_PTR(NULL)/
> 
> Matt

I agree with Dave's original suggestion since casting NULL isn't needed.

> 
>>
>>   from f9d72092cb490 
>>
>> 2) trf7970a
>>   drivers/nfc/trf7970a.c : 896
>>
>>       trf->ignore_timeout =
>>          !cancel_delayed_work(&trf->timeout_work);
>>       trf->rx_skb = ERR_PTR(0);
>>       trf7970a_send_upstream(trf);
>>
>>    from 1961843ceeca0
>>
>> Dave
>> -- 
>>  -----Open up your eyes, open up your mind, open up your code -------   
>> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
>> \        dave @ treblig.org |                               | In Hex /
>>  \ _________________________|_____ http://www.treblig.org   |_______/

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ