Skip to content

Commit 8f83269

Browse files
Joern EngelNicholas Bellinger
authored andcommitted
target: simplify core_tmr_release_req()
And while at it, do minimal coding style fixes in the area. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent 9c7d615 commit 8f83269

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

‎drivers/target/target_core_tmr.c‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,17 @@ int core_tmr_alloc_req(
6464
}
6565
EXPORT_SYMBOL(core_tmr_alloc_req);
6666

67-
void core_tmr_release_req(
68-
struct se_tmr_req *tmr)
67+
void core_tmr_release_req(struct se_tmr_req *tmr)
6968
{
7069
struct se_device *dev = tmr->tmr_dev;
7170
unsigned long flags;
7271

73-
if (!dev) {
74-
kfree(tmr);
75-
return;
72+
if (dev) {
73+
spin_lock_irqsave(&dev->se_tmr_lock, flags);
74+
list_del(&tmr->tmr_list);
75+
spin_unlock_irqrestore(&dev->se_tmr_lock, flags);
7676
}
7777

78-
spin_lock_irqsave(&dev->se_tmr_lock, flags);
79-
list_del(&tmr->tmr_list);
80-
spin_unlock_irqrestore(&dev->se_tmr_lock, flags);
81-
8278
kfree(tmr);
8379
}
8480

@@ -90,9 +86,8 @@ static void core_tmr_handle_tas_abort(
9086
bool remove = true;
9187
/*
9288
* TASK ABORTED status (TAS) bit support
93-
*/
94-
if ((tmr_nacl &&
95-
(tmr_nacl != cmd->se_sess->se_node_acl)) && tas) {
89+
*/
90+
if ((tmr_nacl && (tmr_nacl != cmd->se_sess->se_node_acl)) && tas) {
9691
remove = false;
9792
transport_send_task_abort(cmd);
9893
}

0 commit comments

Comments
 (0)