Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] 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.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Masatake YAMATO and committed by
James Bottomley
1fc2b00f 5f28897d

-1
-1
drivers/scsi/libiscsi.c
··· 507 507 kfifo_in(&session->cmdpool.queue, (void*)&task, sizeof(void*)); 508 508 509 509 if (sc) { 510 - task->sc = NULL; 511 510 /* SCSI eh reuses commands to verify us */ 512 511 sc->SCp.ptr = NULL; 513 512 /*