.. | .. |
---|
268 | 268 | |
---|
269 | 269 | if (bsg_request->msgcode == FC_BSG_RPT_ELS) { |
---|
270 | 270 | rport = fc_bsg_to_rport(bsg_job); |
---|
| 271 | + if (!rport) { |
---|
| 272 | + rval = -ENOMEM; |
---|
| 273 | + goto done; |
---|
| 274 | + } |
---|
271 | 275 | fcport = *(fc_port_t **) rport->dd_data; |
---|
272 | 276 | host = rport_to_shost(rport); |
---|
273 | 277 | vha = shost_priv(host); |
---|
.. | .. |
---|
2541 | 2545 | |
---|
2542 | 2546 | if (bsg_request->msgcode == FC_BSG_RPT_ELS) { |
---|
2543 | 2547 | rport = fc_bsg_to_rport(bsg_job); |
---|
| 2548 | + if (!rport) |
---|
| 2549 | + return ret; |
---|
2544 | 2550 | host = rport_to_shost(rport); |
---|
2545 | 2551 | vha = shost_priv(host); |
---|
2546 | 2552 | } else { |
---|