aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <[email protected]>2018-06-22 14:53:03 -0700
committerMartin K. Petersen <[email protected]>2018-07-02 16:44:32 -0400
commit799d44d0fab60a96a0f13cdb13c9cc94ce06765e (patch)
tree18eac1a8bcf6bd0ee68361a9028eabced91c9068
parentaa090eabcb341b0c023e802884235c29598df1e5 (diff)
scsi: target/tcm_loop: Avoid that static checkers warn about dead code
The code under the "release:" label can only be reached after se_cmd has been set to a non-NULL value. Hence remove the if (se_cmd) test. Keep the else-part since calling transport_generic_free_cmd() is not necessary for a command that has not been submitted to the core. Reported-by: Dan Carpenter <[email protected]> Fixes: 4d3895d5ea43 ("target/tcm_loop: Merge struct tcm_loop_cmd and struct tcm_loop_tmr") Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Mike Christie <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/target/loopback/tcm_loop.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 4c8a97711291..b2e7ff50ff61 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -239,10 +239,7 @@ out:
return ret;
release:
- if (se_cmd)
- transport_generic_free_cmd(se_cmd, 0);
- else
- kmem_cache_free(tcm_loop_cmd_cache, tl_cmd);
+ kmem_cache_free(tcm_loop_cmd_cache, tl_cmd);
goto out;
}