From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, tj@kernel.org
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'
Date: Wed, 16 Aug 2017 12:04:52 +0300 [thread overview]
Message-ID: <928002bb-9f1c-d7df-e04f-fcd5dc5dd73e@cogentembedded.com> (raw)
In-Reply-To: <20170816053103.19773-1-christophe.jaillet@wanadoo.fr>
Hello!
On 8/16/2017 8:31 AM, Christophe JAILLET wrote:
> 'rc' is known to be 0 at this point.
> If 'platform_get_resource()' or 'devm_ioremap()' fail, return -ENOMEM
> instead of 0 which means success.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/ata/ahci_da850.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
> index 1a50cd3b4233..eb46cad4d514 100644
> --- a/drivers/ata/ahci_da850.c
> +++ b/drivers/ata/ahci_da850.c
> @@ -216,12 +216,16 @@ static int ahci_da850_probe(struct platform_device *pdev)
> return rc;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - if (!res)
> + if (!res) {
> + rc = -ENOMEM;
-ENODEV would fit better here.
[...]
MBR, Sergei
next prev parent reply other threads:[~2017-08-16 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 5:31 [PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()' Christophe JAILLET
2017-08-16 9:04 ` Sergei Shtylyov [this message]
2017-08-16 14:40 ` Tejun Heo
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=928002bb-9f1c-d7df-e04f-fcd5dc5dd73e@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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