mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: dlemoal@kernel.org, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] ata: sata_sx4: Add error handling in pdc20621_i2c_read()
Date: Tue, 8 Apr 2025 10:00:10 +0200	[thread overview]
Message-ID: <Z/TXilfhUPuVfXLA@x1-carbon> (raw)
In-Reply-To: <20250408073001.3121-1-vulab@iscas.ac.cn>

On Tue, Apr 08, 2025 at 03:30:01PM +0800, Wentao Liang wrote:
> The function pdc20621_prog_dimm0() calls the function pdc20621_i2c_read()
> but does not handle the error if the read fails. This could lead to
> process with invalid data. A proper implementation can be found in
> /source/drivers/ata/sata_sx4.c, pdc20621_prog_dimm_global(). As mentioned
> in its commit: bb44e154e25125bef31fa956785e90fccd24610b, the variable spd0
> might be used uninitialized when pdc20621_i2c_read() fails.
> 
> Add error handling to pdc20621_i2c_read(). If a read operation fails,
> an error message is logged via dev_err(), and return a negative error
> code.
> 
> Add error handling to pdc20621_prog_dimm0() in pdc20621_dimm_init(), and
> return a negative error code if pdc20621_prog_dimm0() fails.
> 
> Fixes: 4447d3515616 ("libata: convert the remaining SATA drivers to new init model")
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---

Reviewed-by: Niklas Cassel <cassel@kernel.org>

  reply	other threads:[~2025-04-08  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  7:30 Wentao Liang
2025-04-08  8:00 ` Niklas Cassel [this message]
2025-04-09  6:26 ` Damien Le Moal

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=Z/TXilfhUPuVfXLA@x1-carbon \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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®