The -EAGAIN status is passed through an "rc" variable instead of a less
common flow.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (ready)
goto desperate;
- bytes_done = -EAGAIN;
+ rc = -EAGAIN;
break;
}
if (channel->endpoint->fatal_error)
return -EIO;
+ if (rc)
+ return rc;
+
return bytes_done;
}
*/
if (filp->f_flags & O_NONBLOCK) {
- bytes_done = -EAGAIN;
+ rc = -EAGAIN;
break;
}
&channel->rd_workitem,
XILLY_RX_TIMEOUT);
+ if (channel->endpoint->fatal_error)
+ return -EIO;
+
+ if (rc)
+ return rc;
+
if ((channel->rd_synchronous) && (bytes_done > 0)) {
rc = xillybus_myflush(filp->private_data, 0); /* No timeout */
return rc;
}
- if (channel->endpoint->fatal_error)
- return -EIO;
-
return bytes_done;
}