Message ID | EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6915E9AA36@dggeml505-mbx.china.huawei.com (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
Series | scsi:libfc:fix fc_lport_ptp_setup(): Null pointer dereferences | expand |
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 684c5e3..36e7bdd 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -238,6 +238,10 @@ static void fc_lport_ptp_setup(struct fc_lport *lport, } mutex_lock(&lport->disc.disc_mutex); lport->ptp_rdata = fc_rport_create(lport, remote_fid); + if (!lport->ptp_rdata) { + mutex_unlock(&lport->disc.disc_mutex); + return; + } kref_get(&lport->ptp_rdata->kref); lport->ptp_rdata->ids.port_name = remote_wwpn; lport->ptp_rdata->ids.node_name = remote_wwnn;