[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7262bda-8669-3910-9e8c-e72a68eb3325@opensource.wdc.com>
Date: Thu, 27 Jan 2022 11:15:11 +0900
From: Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To: Sergey Shtylyov <s.shtylyov@....ru>,
Zhou Qingyang <zhou1615@....edu>
Cc: kjlu@....edu, Alexander Shiyan <shc_work@...l.ru>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Jens Axboe <axboe@...nel.dk>, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ata: pata_platform: Fix a NULL pointer dereference in
__pata_platform_probe()
On 1/25/22 18:46, Sergey Shtylyov wrote:
> On 1/24/22 7:45 PM, Zhou Qingyang wrote:
>
>> In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and
>> there is a dereference of it right after that, which could introduce a
>> NULL pointer dereference bug.
>>
>> Fix this by adding a NULL check of ap->ops.
>>
>> This bug was found by a static analyzer.
>>
>> Builds with 'make allyesconfig' show no new warnings,
>> and our static analyzer no longer warns about this code.
>>
>> Fixes: f3d5e4f18dba ("ata: pata_of_platform: Allow to use 16-bit wide data transfer")
>> Signed-off-by: Zhou Qingyang <zhou1615@....edu>
>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@....ru>
Please see my note about the typo in the fix. I kept you RB tag. Let me
know if that is OK.
>
> [...]
>
> MBR, Sergey
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists