Skip to contentSkip to conversation

libiscsi: avoid unnecessary multiple NULL assignments

PATCH RESEND New Masatake YAMATO 1 participant 1 message Jan 23, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 libiscsi: avoid unnecessary multiple NULL assignments

In iscsi_free_task, NULL is assigned to task->sc twice: before and after kfifo_in invocatoin. Allocating and freeing iscsi_task are guarded with session->lock, so multiple NULL assignments cause no trouble. But people reading the source code may be confused.

The second NULL assignment comes from commit:

    3e5c28ad0391389959ccae81c938c7533efb3490

It seems that the line after kfifo_in invocation was introduced accidentally.

---
 drivers/scsi/libiscsi.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/libiscsi.c +0 -1
index 82c3fd4..7aacf3a 100644
@@ -507,7 +507,6 @@ static void iscsi_free_task(struct iscsi_task *task)
 	kfifo_in(&session->cmdpool.queue, (void*)&task, sizeof(void*));
 
 	if (sc) {
-		task->sc = NULL;
 		/* SCSI eh reuses commands to verify us */
 		sc->SCp.ptr = NULL;
 		/*
Signature · 1 line
1.7.11.7