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>
This commit is contained in:
Corey Minyard 2021-09-30 16:12:55 -05:00
Родитель b36eb5e7b7
Коммит 17a4262799
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -247,11 +247,13 @@ static int handle_recv(struct ipmi_file_private *priv,
if (msg->msg.data_len > 0) { if (msg->msg.data_len > 0) {
if (rsp->msg.data_len < msg->msg.data_len) { 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; msg->msg.data_len = rsp->msg.data_len;
else } else {
rv = -EMSGSIZE;
goto recv_putback_on_err; goto recv_putback_on_err;
}
} }
if (copy_to_user(rsp->msg.data, if (copy_to_user(rsp->msg.data,