Re: [PATCH] pata_lagacy: Handle failed ATA timing computation in opti82c46x_set_piomode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

On 10/18/23 3:52 AM, Haonan Li wrote:

> The function opti82c46x_set_piomode utilizes the ata_timing_compute()
> to determine the appropriate ATA timings for a given device. However,
> in certain conditions where the ata_timing_find_mode() function does
> not find a valid mode, ata_timing_compute() returns an error (-EINVAL),
> leaving the tp struct uninitialized.

   Looks like it's very common to ignore the result of ata_timing_compute()
in drivers/ata/...
   Mind sharing the "certain conditions"? :-) I don't think the set_piomode()
method can be called by libata itself with an unsupported xfer mode...

> This patch checks the return value of ata_timing_compute() and print
> err message. This avoids any potential use of uninitialized `tp`
> struct in the opti82c46x_set_piomode function.
> 
> Signed-off-by: Haonan Li <lihaonan1105@xxxxxxxxx>
[...]

Reviewed-by: Sergey Shtylyov <s.shtylyov@xxxxxx>

MBR, Sergey



[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux