Merge branch 'idr-4.11' of git://git.infradead.org/users/willy/linux-dax
[sfrench/cifs-2.6.git] / drivers / target / target_core_user.c
index 5c1cb2df3a548b354a712dd12bba926eb2786bdd..c3adefe95e50f7f7054e272e15fc5e37663d11c9 100644 (file)
@@ -642,9 +642,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)
                WARN_ON(tcmu_hdr_get_op(entry->hdr.len_op) != TCMU_OP_CMD);
 
                spin_lock(&udev->commands_lock);
-               cmd = idr_find(&udev->commands, entry->hdr.cmd_id);
-               if (cmd)
-                       idr_remove(&udev->commands, cmd->cmd_id);
+               cmd = idr_remove(&udev->commands, entry->hdr.cmd_id);
                spin_unlock(&udev->commands_lock);
 
                if (!cmd) {