Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -3
+5 -3
drivers/char/ipmi/ipmi_devintf.c
··· 247 247 248 248 if (msg->msg.data_len > 0) { 249 249 if (rsp->msg.data_len < msg->msg.data_len) { 250 - rv2 = -EMSGSIZE; 251 - if (trunc) 250 + if (trunc) { 251 + rv2 = -EMSGSIZE; 252 252 msg->msg.data_len = rsp->msg.data_len; 253 - else 253 + } else { 254 + rv = -EMSGSIZE; 254 255 goto recv_putback_on_err; 256 + } 255 257 } 256 258 257 259 if (copy_to_user(rsp->msg.data,