diff options
author | Corey Minyard | 2021-09-30 16:12:55 -0500 |
---|---|---|
committer | Corey Minyard | 2021-10-05 06:54:16 -0500 |
commit | 17a4262799fa7449e8fe06fe6d930ab7f5f32528 (patch) | |
tree | 8efa68c75d690554d4f2b99b258117b50122aaf7 /drivers/char | |
parent | b36eb5e7b75a756baa64909a176dd4269ee05a8b (diff) |
ipmi:devintf: Return a proper error when recv buffer too small
The right error message wasn't being set in one location, and it would
return success on a failure.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_devintf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 3dd1d5abb298..d160fa4c73fe 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c @@ -247,11 +247,13 @@ static int handle_recv(struct ipmi_file_private *priv, if (msg->msg.data_len > 0) { if (rsp->msg.data_len < msg->msg.data_len) { - rv2 = -EMSGSIZE; - if (trunc) + if (trunc) { + rv2 = -EMSGSIZE; msg->msg.data_len = rsp->msg.data_len; - else + } else { + rv = -EMSGSIZE; goto recv_putback_on_err; + } } if (copy_to_user(rsp->msg.data, |