Skip to content

Commit c81c552

Browse files
LiBaokun96intel-lab-lkp
authored andcommitted
cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read()
The err_put_fd tag is only used once, so remove it to make the code more readable. Signed-off-by: Baokun Li <[email protected]> Reviewed-by: Jia Zhu <[email protected]>
1 parent 96eb311 commit c81c552

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/cachefiles/ondemand.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ ssize_t cachefiles_ondemand_daemon_read(struct cachefiles_cache *cache,
347347

348348
if (copy_to_user(_buffer, msg, n) != 0) {
349349
ret = -EFAULT;
350-
goto err_put_fd;
350+
if (msg->opcode == CACHEFILES_OP_OPEN)
351+
close_fd(((struct cachefiles_open *)msg->data)->fd);
352+
goto error;
351353
}
352354

353355
/* CLOSE request has no reply */
@@ -358,9 +360,6 @@ ssize_t cachefiles_ondemand_daemon_read(struct cachefiles_cache *cache,
358360

359361
return n;
360362

361-
err_put_fd:
362-
if (msg->opcode == CACHEFILES_OP_OPEN)
363-
close_fd(((struct cachefiles_open *)msg->data)->fd);
364363
error:
365364
xa_erase(&cache->reqs, id);
366365
req->error = ret;

0 commit comments

Comments
 (0)