diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index cd61905ca2f55edbc4f43074ad43417ddac792ec..30f62b65ffa9e77e617e0670494be88b7558cf0f 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -477,7 +477,9 @@ static void qedf_update_link_speed(struct qedf_ctx *qedf, lport->link_supported_speeds |= FC_PORTSPEED_50GBIT; if (link->supported_caps & SUPPORTED_100000baseKR4_Full) lport->link_supported_speeds |= FC_PORTSPEED_100GBIT; - fc_host_supported_speeds(lport->host) = lport->link_supported_speeds; + if (lport->host && lport->host->shost_data) + fc_host_supported_speeds(lport->host) = + lport->link_supported_speeds; } static void qedf_link_update(void *dev, struct qed_link_output *link)