diff options
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_user.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 8041710b6972..18f0ec2e1f9c 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -642,9 +642,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) | |||
642 | WARN_ON(tcmu_hdr_get_op(entry->hdr.len_op) != TCMU_OP_CMD); | 642 | WARN_ON(tcmu_hdr_get_op(entry->hdr.len_op) != TCMU_OP_CMD); |
643 | 643 | ||
644 | spin_lock(&udev->commands_lock); | 644 | spin_lock(&udev->commands_lock); |
645 | cmd = idr_find(&udev->commands, entry->hdr.cmd_id); | 645 | cmd = idr_remove(&udev->commands, entry->hdr.cmd_id); |
646 | if (cmd) | ||
647 | idr_remove(&udev->commands, cmd->cmd_id); | ||
648 | spin_unlock(&udev->commands_lock); | 646 | spin_unlock(&udev->commands_lock); |
649 | 647 | ||
650 | if (!cmd) { | 648 | if (!cmd) { |