lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ipmi: msghandler: ensure error value in rv is being returned on error
Date
From: Colin Ian King <colin.king@canonical.com>

Currently ipmi_set_my_LUN returns 0 instead of -EINVAL if the channel
is out of range. Fix this by returning the error return rv instead of 0.

Detected by Clang ("variable 'rv' set but not used")

Fixes: 048f7c3e352e ("ipmi: Properly release srcu locks on error conditions")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/char/ipmi/ipmi_msghandler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 04f64c55e275..a74ce885b541 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1344,7 +1344,7 @@ int ipmi_set_my_LUN(struct ipmi_user *user,
user->intf->addrinfo[channel].lun = LUN & 0x3;
release_ipmi_user(user, index);

- return 0;
+ return rv;
}
EXPORT_SYMBOL(ipmi_set_my_LUN);

--
2.17.1
\
 
 \ /
  Last update: 2018-08-28 16:39    [W:0.044 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site