* [PATCH] ipmi_si: Fix wrong return value in try_smi_init()
@ 2020-10-05 14:52 Tianjia Zhang
2020-10-05 18:31 ` Corey Minyard
0 siblings, 1 reply; 2+ messages in thread
From: Tianjia Zhang @ 2020-10-05 14:52 UTC (permalink / raw)
To: Corey Minyard, Arnd Bergmann, Greg Kroah-Hartman,
openipmi-developer, linux-kernel
On an error exit path, a negative error code should be returned
instead of a positive return value.
Fixes: 90b2d4f15ff7 ("ipmi_si: Remove hacks for adding a dummy platform devices")
Cc: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
drivers/char/ipmi/ipmi_si_intf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 77b8d551ae7f..dd559661c15b 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1963,7 +1963,7 @@ static int try_smi_init(struct smi_info *new_smi)
/* Do this early so it's available for logs. */
if (!new_smi->io.dev) {
pr_err("IPMI interface added with no device\n");
- rv = EIO;
+ rv = -EIO;
goto out_err;
}
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipmi_si: Fix wrong return value in try_smi_init()
2020-10-05 14:52 [PATCH] ipmi_si: Fix wrong return value in try_smi_init() Tianjia Zhang
@ 2020-10-05 18:31 ` Corey Minyard
0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2020-10-05 18:31 UTC (permalink / raw)
To: Tianjia Zhang
Cc: Arnd Bergmann, Greg Kroah-Hartman, openipmi-developer, linux-kernel
On Mon, Oct 05, 2020 at 10:52:12PM +0800, Tianjia Zhang wrote:
> On an error exit path, a negative error code should be returned
> instead of a positive return value.
Thanks! In my tree for the next release.
-corey
>
> Fixes: 90b2d4f15ff7 ("ipmi_si: Remove hacks for adding a dummy platform devices")
> Cc: Corey Minyard <cminyard@mvista.com>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
> drivers/char/ipmi/ipmi_si_intf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 77b8d551ae7f..dd559661c15b 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -1963,7 +1963,7 @@ static int try_smi_init(struct smi_info *new_smi)
> /* Do this early so it's available for logs. */
> if (!new_smi->io.dev) {
> pr_err("IPMI interface added with no device\n");
> - rv = EIO;
> + rv = -EIO;
> goto out_err;
> }
>
> --
> 2.24.3 (Apple Git-128)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-05 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 14:52 [PATCH] ipmi_si: Fix wrong return value in try_smi_init() Tianjia Zhang
2020-10-05 18:31 ` 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.