All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi: missing error code in try_smi_init()
@ 2018-03-06  9:58 Dan Carpenter
  2018-03-06 10:03 ` Arnd Bergmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dan Carpenter @ 2018-03-06  9:58 UTC (permalink / raw)
  To: kernel-janitors

If platform_device_alloc() then we should return -ENOMEM instead of
returning success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index f2a294f78892..ff870aa91cfe 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2071,6 +2071,7 @@ static int try_smi_init(struct smi_info *new_smi)
 						      new_smi->intf_num);
 		if (!new_smi->pdev) {
 			pr_err(PFX "Unable to allocate platform device\n");
+			rv = -ENOMEM;
 			goto out_err;
 		}
 		new_smi->io.dev = &new_smi->pdev->dev;

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

* Re: [PATCH] ipmi: missing error code in try_smi_init()
  2018-03-06  9:58 [PATCH] ipmi: missing error code in try_smi_init() Dan Carpenter
@ 2018-03-06 10:03 ` Arnd Bergmann
  2018-03-06 10:26 ` Julia Lawall
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-03-06 10:03 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Mar 6, 2018 at 10:58 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> If platform_device_alloc() then we should return -ENOMEM instead of
> returning success.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks good, though I would probably remove that incorrect 'rv = 0' as well
so gcc can catch similar problems in case the function gets changed
again.

> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index f2a294f78892..ff870aa91cfe 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2071,6 +2071,7 @@ static int try_smi_init(struct smi_info *new_smi)
>                                                       new_smi->intf_num);
>                 if (!new_smi->pdev) {
>                         pr_err(PFX "Unable to allocate platform device\n");
> +                       rv = -ENOMEM;
>                         goto out_err;
>                 }
>                 new_smi->io.dev = &new_smi->pdev->dev;

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

* Re: [PATCH] ipmi: missing error code in try_smi_init()
  2018-03-06  9:58 [PATCH] ipmi: missing error code in try_smi_init() Dan Carpenter
  2018-03-06 10:03 ` Arnd Bergmann
@ 2018-03-06 10:26 ` Julia Lawall
  2018-03-06 10:38 ` Dan Carpenter
  2018-03-06 13:20 ` Corey Minyard
  3 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2018-03-06 10:26 UTC (permalink / raw)
  To: kernel-janitors



On Tue, 6 Mar 2018, Dan Carpenter wrote:

> If platform_device_alloc() then we should return -ENOMEM instead of
> returning success.

It looks like the word "fails" got lost here.

julia

>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index f2a294f78892..ff870aa91cfe 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2071,6 +2071,7 @@ static int try_smi_init(struct smi_info *new_smi)
>  						      new_smi->intf_num);
>  		if (!new_smi->pdev) {
>  			pr_err(PFX "Unable to allocate platform device\n");
> +			rv = -ENOMEM;
>  			goto out_err;
>  		}
>  		new_smi->io.dev = &new_smi->pdev->dev;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] ipmi: missing error code in try_smi_init()
  2018-03-06  9:58 [PATCH] ipmi: missing error code in try_smi_init() Dan Carpenter
  2018-03-06 10:03 ` Arnd Bergmann
  2018-03-06 10:26 ` Julia Lawall
@ 2018-03-06 10:38 ` Dan Carpenter
  2018-03-06 13:20 ` Corey Minyard
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2018-03-06 10:38 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Mar 06, 2018 at 11:26:19AM +0100, Julia Lawall wrote:
> 
> 
> On Tue, 6 Mar 2018, Dan Carpenter wrote:
> 
> > If platform_device_alloc() then we should return -ENOMEM instead of
> > returning success.
> 
> It looks like the word "fails" got lost here.
> 

Thanks.  Let me resend.

regards,
dan carpenter


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

* Re: [PATCH] ipmi: missing error code in try_smi_init()
  2018-03-06  9:58 [PATCH] ipmi: missing error code in try_smi_init() Dan Carpenter
                   ` (2 preceding siblings ...)
  2018-03-06 10:38 ` Dan Carpenter
@ 2018-03-06 13:20 ` Corey Minyard
  3 siblings, 0 replies; 5+ messages in thread
From: Corey Minyard @ 2018-03-06 13:20 UTC (permalink / raw)
  To: kernel-janitors

On 03/06/2018 03:58 AM, Dan Carpenter wrote:
> If platform_device_alloc() then we should return -ENOMEM instead of
> returning success.

Thanks, queued for next release.

-corey

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index f2a294f78892..ff870aa91cfe 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2071,6 +2071,7 @@ static int try_smi_init(struct smi_info *new_smi)
>   						      new_smi->intf_num);
>   		if (!new_smi->pdev) {
>   			pr_err(PFX "Unable to allocate platform device\n");
> +			rv = -ENOMEM;
>   			goto out_err;
>   		}
>   		new_smi->io.dev = &new_smi->pdev->dev;



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

end of thread, other threads:[~2018-03-06 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06  9:58 [PATCH] ipmi: missing error code in try_smi_init() Dan Carpenter
2018-03-06 10:03 ` Arnd Bergmann
2018-03-06 10:26 ` Julia Lawall
2018-03-06 10:38 ` Dan Carpenter
2018-03-06 13:20 ` Corey Minyard

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.