Re: [Openipmi-developer] [PATCH] ipmi: missing error code in try_smi_init()

2018-03-06 Thread Corey Minyard

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 

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 = _smi->pdev->dev;




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH] ipmi: missing error code in try_smi_init()

2018-03-06 Thread Dan Carpenter
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


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH] ipmi: missing error code in try_smi_init()

2018-03-06 Thread Julia Lawall


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 
>
> 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 = _smi->pdev->dev;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH] ipmi: missing error code in try_smi_init()

2018-03-06 Thread Arnd Bergmann
On Tue, Mar 6, 2018 at 10:58 AM, Dan Carpenter  wrote:
> If platform_device_alloc() then we should return -ENOMEM instead of
> returning success.
>
> Signed-off-by: Dan Carpenter 

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 = _smi->pdev->dev;

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


[Openipmi-developer] [PATCH] ipmi: missing error code in try_smi_init()

2018-03-06 Thread Dan Carpenter
If platform_device_alloc() then we should return -ENOMEM instead of
returning success.

Signed-off-by: Dan Carpenter 

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 = _smi->pdev->dev;

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer