Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712781

Re: [PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'
Date 2017-08-16 11:10 +0200
Message-ID <uf2uR-5aP-7@gated-at.bofh.it> (permalink)
References <ueZdD-30Q-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-16 07:40 +0200
  Re: [PATCH] sata: ahci-da850: Fix some error handling paths in  'ahci_da850_probe()' Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-08-16 11:10 +0200
  Re: [PATCH] sata: ahci-da850: Fix some error handling paths in  'ahci_da850_probe()' Tejun Heo <tj@kernel.org> - 2017-08-16 16:50 +0200

csiph-web