All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Potential null-pointer-dereference problem due to missing null-checking for ata_timing_find_mode
       [not found] <TYCP286MB1188D47BA1A976E4090AF2B88A829@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM>
@ 2021-10-24 23:24 ` Damien Le Moal
  0 siblings, 0 replies; only message in thread
From: Damien Le Moal @ 2021-10-24 23:24 UTC (permalink / raw)
  To: YE Chengfeng; +Cc: linux-ide, linux-kernel

On 2021/10/25 3:08, YE Chengfeng wrote:
> Hi,
> 
> I found that the function *ata_timing_find_mode *could return a null pointer in
> some situattions, but some call sites of this function don't check whether the
> return value is a null pointer. Could it be a potential null-pointer-dereference
> problem? 
> https://github.com/torvalds/linux/blob/master/drivers/ata/pata_acpi.c#L145
> <https://github.com/torvalds/linux/blob/master/drivers/ata/pata_acpi.c#L145>
> <https://github.com/torvalds/linux/blob/master/drivers/ata/pata_acpi.c#L145>
> 	
> linux/pata_acpi.c at master · torvalds/linux
> <https://github.com/torvalds/linux/blob/master/drivers/ata/pata_acpi.c#L145>
> Linux kernel source tree. Contribute to torvalds/linux development by creating
> an account on GitHub.
> github.com
> 
> 
> 
> Best Regards,
> - Chengfeng

The ata_timing array last element is 0xff, which is the initial value of pio/dma
mode. So an entry will always be returned. I do not think the NULL return ever
triggers.

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-24 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <TYCP286MB1188D47BA1A976E4090AF2B88A829@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM>
2021-10-24 23:24 ` Potential null-pointer-dereference problem due to missing null-checking for ata_timing_find_mode Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.