diff options
author | Bodo Stroesser <bostroesser@gmail.com> | 2021-04-23 17:01:23 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-04-28 22:55:00 -0400 |
commit | 9814b55cde0588b6d9bc496cee43f87316cbc6f1 (patch) | |
tree | 63925f04edb5d656d374c7b253011a926b56bd95 /drivers | |
parent | 2f1137140fbcffad582d9e5eacc7f189ae0cc110 (diff) | |
download | linux-stable-9814b55cde0588b6d9bc496cee43f87316cbc6f1.tar.gz linux-stable-9814b55cde0588b6d9bc496cee43f87316cbc6f1.tar.bz2 linux-stable-9814b55cde0588b6d9bc496cee43f87316cbc6f1.zip |
scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
If tcmu_handle_completions() finds an invalid cmd_id while looping over cmd
responses from userspace it sets TCMU_DEV_BIT_BROKEN and breaks the
loop. This means that it does further handling for the tcmu device.
Skip that handling by replacing 'break' with 'return'.
Additionally change tcmu_handle_completions() from unsigned int to bool,
since the value used in return already is bool.
Link: https://lore.kernel.org/r/20210423150123.24468-1-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index eec2fd573e2b..198d25ae482a 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1413,7 +1413,7 @@ static int tcmu_run_tmr_queue(struct tcmu_dev *udev) return 1; } -static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) +static bool tcmu_handle_completions(struct tcmu_dev *udev) { struct tcmu_mailbox *mb; struct tcmu_cmd *cmd; @@ -1456,7 +1456,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) pr_err("cmd_id %u not found, ring is broken\n", entry->hdr.cmd_id); set_bit(TCMU_DEV_BIT_BROKEN, &udev->flags); - break; + return false; } tcmu_handle_completion(cmd, entry); |