forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
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 {