hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/scsi/qla2xxx/qla_bsg.c
....@@ -268,6 +268,10 @@
268268
269269 if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
270270 rport = fc_bsg_to_rport(bsg_job);
271
+ if (!rport) {
272
+ rval = -ENOMEM;
273
+ goto done;
274
+ }
271275 fcport = *(fc_port_t **) rport->dd_data;
272276 host = rport_to_shost(rport);
273277 vha = shost_priv(host);
....@@ -2541,6 +2545,8 @@
25412545
25422546 if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
25432547 rport = fc_bsg_to_rport(bsg_job);
2548
+ if (!rport)
2549
+ return ret;
25442550 host = rport_to_shost(rport);
25452551 vha = shost_priv(host);
25462552 } else {