Commit 17a42627 authored by Corey Minyard's avatar Corey Minyard
Browse files

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: default avatarCorey Minyard <cminyard@mvista.com>
parent b36eb5e7
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -247,12 +247,14 @@ static int handle_recv(struct ipmi_file_private *priv,

	if (msg->msg.data_len > 0) {
		if (rsp->msg.data_len < msg->msg.data_len) {
			if (trunc) {
				rv2 = -EMSGSIZE;
			if (trunc)
				msg->msg.data_len = rsp->msg.data_len;
			else
			} else {
				rv = -EMSGSIZE;
				goto recv_putback_on_err;
			}
		}

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