ipmi_si: Fix wrong return value in try_smi_init()
PATCH 1/1 ipmi_si: Fix wrong return value in try_smi_init()
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 <[email protected]>
Signed-off-by Tianjia Zhang <[email protected]>
--- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/ipmi/ipmi_si_intf.c +1 -1
@@ -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; }
Signature · 1 line
2.24.3 (Apple Git-128)
Quoted 2 lines · Tianjia Zhang
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
Quoted 24 lines
Fixes 90b2d4f15ff7 ("ipmi_si: Remove hacks for adding a dummy platform devices")Cc Corey Minyard <[email protected]>Signed-off-by Tianjia Zhang <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/ipmi/ipmi_si_intf.c +1
-1@@ -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; }Signature · 1 line
2.24.3 (Apple Git-128)