mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Li Zhong <floridsleeves@gmail.com>,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v2] ata: libata-core: Check errors in sata_print_link_status()
Date: Fri, 16 Sep 2022 15:21:30 +0100	[thread overview]
Message-ID: <7b7f36d4-9aa5-fff5-bd82-3658be6496f4@opensource.wdc.com> (raw)
In-Reply-To: <20220903231039.2278817-1-floridsleeves@gmail.com>

On 2022/09/04 0:10, Li Zhong wrote:
> sata_scr_read() could return negative error code on failure. Check the
> return value when reading the control register.
> 
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/ata/libata-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 826d41f341e4..ae08c7d35cb0 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -3021,7 +3021,8 @@ static void sata_print_link_status(struct ata_link *link)
>  
>  	if (sata_scr_read(link, SCR_STATUS, &sstatus))
>  		return;
> -	sata_scr_read(link, SCR_CONTROL, &scontrol);
> +	if (sata_scr_read(link, SCR_CONTROL, &scontrol))
> +		return;
>  
>  	if (ata_phys_link_online(link)) {
>  		tmp = (sstatus >> 4) & 0xf;

Applied to for-6.1. Thanks.

-- 
Damien Le Moal
Western Digital Research


      reply	other threads:[~2022-09-16 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 23:10 Li Zhong
2022-09-16 14:21 ` Damien Le Moal [this message]

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=7b7f36d4-9aa5-fff5-bd82-3658be6496f4@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=floridsleeves@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®