Skip to content

Commit fe35a40

Browse files
Varun Prakashmartinkpetersen
authored andcommitted
scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state()
Assign fc_vport to ln->fc_vport before calling csio_fcoe_alloc_vnp() to avoid a NULL pointer dereference in csio_vport_set_state(). ln->fc_vport is dereferenced in csio_vport_set_state(). Signed-off-by: Varun Prakash <varun@chelsio.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c41f598 commit fe35a40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/csiostor/csio_attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable)
594594
}
595595

596596
fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING);
597+
ln->fc_vport = fc_vport;
597598

598599
if (csio_fcoe_alloc_vnp(hw, ln))
599600
goto error;
600601

601602
*(struct csio_lnode **)fc_vport->dd_data = ln;
602-
ln->fc_vport = fc_vport;
603603
if (!fc_vport->node_name)
604604
fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln));
605605
if (!fc_vport->port_name)

0 commit comments

Comments
 (0)