Skip to content

Commit 17a4262

Browse files
committed
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 <[email protected]>
1 parent b36eb5e commit 17a4262

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/char/ipmi/ipmi_devintf.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,13 @@ static int handle_recv(struct ipmi_file_private *priv,
247247

248248
if (msg->msg.data_len > 0) {
249249
if (rsp->msg.data_len < msg->msg.data_len) {
250-
rv2 = -EMSGSIZE;
251-
if (trunc)
250+
if (trunc) {
251+
rv2 = -EMSGSIZE;
252252
msg->msg.data_len = rsp->msg.data_len;
253-
else
253+
} else {
254+
rv = -EMSGSIZE;
254255
goto recv_putback_on_err;
256+
}
255257
}
256258

257259
if (copy_to_user(rsp->msg.data,

0 commit comments

Comments
 (0)