All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect
@ 2017-11-17 16:35 Arvind Yadav
  2017-11-27  9:31 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-11-17 16:35 UTC (permalink / raw)
  To: ulf.hansson, wsa+renesas; +Cc: linux-kernel, linux-mmc

platform_get_irq_byname() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/mmc/host/usdhi6rol0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
index cdfeb15..5a896de 100644
--- a/drivers/mmc/host/usdhi6rol0.c
+++ b/drivers/mmc/host/usdhi6rol0.c
@@ -1749,7 +1749,7 @@ static int usdhi6_probe(struct platform_device *pdev)
 	irq_cd = platform_get_irq_byname(pdev, "card detect");
 	irq_sd = platform_get_irq_byname(pdev, "data");
 	irq_sdio = platform_get_irq_byname(pdev, "SDIO");
-	if (irq_sd < 0 || irq_sdio < 0)
+	if (irq_cd < 0 || irq_sd < 0 || irq_sdio < 0)
 		return -ENODEV;
 
 	mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect
  2017-11-17 16:35 [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect Arvind Yadav
@ 2017-11-27  9:31 ` Ulf Hansson
  2017-11-27  9:34   ` Arvind Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2017-11-27  9:31 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: Wolfram Sang, linux-kernel, linux-mmc

On 17 November 2017 at 17:35, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> platform_get_irq_byname() can fail here and we must check its return value.

NAK.

You need to check the code more carefully. irq_cd is dealt with later
below in the same function with proper error handling.

>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/mmc/host/usdhi6rol0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
> index cdfeb15..5a896de 100644
> --- a/drivers/mmc/host/usdhi6rol0.c
> +++ b/drivers/mmc/host/usdhi6rol0.c
> @@ -1749,7 +1749,7 @@ static int usdhi6_probe(struct platform_device *pdev)
>         irq_cd = platform_get_irq_byname(pdev, "card detect");
>         irq_sd = platform_get_irq_byname(pdev, "data");
>         irq_sdio = platform_get_irq_byname(pdev, "SDIO");
> -       if (irq_sd < 0 || irq_sdio < 0)
> +       if (irq_cd < 0 || irq_sd < 0 || irq_sdio < 0)
>                 return -ENODEV;
>
>         mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect
  2017-11-27  9:31 ` Ulf Hansson
@ 2017-11-27  9:34   ` Arvind Yadav
  0 siblings, 0 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-11-27  9:34 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Wolfram Sang, linux-kernel, linux-mmc

Hi,


On Monday 27 November 2017 03:01 PM, Ulf Hansson wrote:
> On 17 November 2017 at 17:35, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
>> platform_get_irq_byname() can fail here and we must check its return value.
> NAK.
>
> You need to check the code more carefully. irq_cd is dealt with later
> below in the same function with proper error handling.
Yes, your are right. Sorry for noise.
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>>   drivers/mmc/host/usdhi6rol0.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
>> index cdfeb15..5a896de 100644
>> --- a/drivers/mmc/host/usdhi6rol0.c
>> +++ b/drivers/mmc/host/usdhi6rol0.c
>> @@ -1749,7 +1749,7 @@ static int usdhi6_probe(struct platform_device *pdev)
>>          irq_cd = platform_get_irq_byname(pdev, "card detect");
>>          irq_sd = platform_get_irq_byname(pdev, "data");
>>          irq_sdio = platform_get_irq_byname(pdev, "SDIO");
>> -       if (irq_sd < 0 || irq_sdio < 0)
>> +       if (irq_cd < 0 || irq_sd < 0 || irq_sdio < 0)
>>                  return -ENODEV;
>>
>>          mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
>> --
>> 2.7.4
>>
~arvind

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-27  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 16:35 [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect Arvind Yadav
2017-11-27  9:31 ` Ulf Hansson
2017-11-27  9:34   ` Arvind Yadav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.