]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
authorBodo Stroesser <bostroesser@gmail.com>
Fri, 23 Apr 2021 15:01:23 +0000 (17:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 09:40:54 +0000 (11:40 +0200)
commitd47d0d1a1fb2cddbc322a7ff19ccfc127cb561c5
tree123b2b4f0a54c1b9f980827c0184b85246eda3dc
parent3611ce2f23a4be659eae66da2ee7acafd6e5b267
scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found

[ Upstream commit 9814b55cde0588b6d9bc496cee43f87316cbc6f1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_user.c