Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
case 0: /* orderly shutdown */
return -EPIPE;
case sizeof(*lur):
+ {
+ int err = 0;
+
if (lur->handle != expected_handle) {
ERR("Unexpected result message handle: "
"expected: %u vs received: %u\n",
expected_handle, lur->handle);
- return -EINVAL;
+ err = 1;
}
if (lur->cmd != expected_cmd) {
ERR("Unexpected result message command "
"expected: %u vs received: %u\n",
expected_cmd, lur->cmd);
+ err = 1;
+ }
+ if (err) {
return -EINVAL;
+ } else {
+ return lur->ret_code;
}
- return lur->ret_code;
+ }
default:
if (len >= 0) {
ERR("incorrect message size: %zd\n", len);