diff
list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
    if (fcport->edif.enable) {
        if (pcnt >= app_req.num_ports)
            break;
+       if (pcnt < app_req.num_ports) {
            app_reply->elem[pcnt].rekey_count =
                fcport->edif.rekey_cnt;
            app_reply->elem[pcnt].tx_bytes =
                fcport->edif.tx_bytes;
            app_reply->elem[pcnt].rx_bytes =
                fcport->edif.rx_bytes;

            memcpy(app_reply->elem[pcnt].remote_wwpn,
                fcport->port_name, 8);

            pcnt++;
+       }
    }
}
