From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Haonan Li <lihaonan1105@gmail.com>,
Damien Le Moal <dlemoal@kernel.org>, <linux-ide@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pata_lagacy: Handle failed ATA timing computation in opti82c46x_set_piomode
Date: Wed, 18 Oct 2023 20:15:25 +0300 [thread overview]
Message-ID: <8332cf70-1451-6903-562f-1d16e4c243ae@omp.ru> (raw)
In-Reply-To: <20231018005220.2551586-1-lihaonan1105@gmail.com>
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@gmail.com>
[...]
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
MBR, Sergey
next prev parent reply other threads:[~2023-10-18 17:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 23:32 Haonan Li
2023-10-17 23:36 ` Damien Le Moal
2023-10-18 0:52 ` Haonan Li
2023-10-18 6:19 ` Damien Le Moal
2023-10-18 17:15 ` Sergey Shtylyov [this message]
2023-10-18 17:59 ` Haonan Li
2023-10-18 0:50 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8332cf70-1451-6903-562f-1d16e4c243ae@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=dlemoal@kernel.org \
--cc=lihaonan1105@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®