Skip to content

Commit 8c39673

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Check sas_port before using it
Need to check the structure sas_port before using it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3b294c0 commit 8c39673

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,12 +974,13 @@ static void hisi_sas_port_notify_formed(struct asd_sas_phy *sas_phy)
974974
struct hisi_hba *hisi_hba = sas_ha->lldd_ha;
975975
struct hisi_sas_phy *phy = sas_phy->lldd_phy;
976976
struct asd_sas_port *sas_port = sas_phy->port;
977-
struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
977+
struct hisi_sas_port *port;
978978
unsigned long flags;
979979

980980
if (!sas_port)
981981
return;
982982

983+
port = to_hisi_sas_port(sas_port);
983984
spin_lock_irqsave(&hisi_hba->lock, flags);
984985
port->port_attached = 1;
985986
port->id = phy->port_id;

0 commit comments

Comments
 (0)