net/sfc: check ID overflow in action port ID
[dpdk.git] / drivers / net / sfc / sfc_mae.c
index 33bff27..2ea2d63 100644 (file)
@@ -2653,6 +2653,9 @@ sfc_mae_rule_parse_action_port_id(struct sfc_adapter *sa,
        uint16_t port_id;
        int rc;
 
+       if (conf->id > UINT16_MAX)
+               return EOVERFLOW;
+
        port_id = (conf->original != 0) ? sas->port_id : conf->id;
 
        rc = sfc_mae_switch_port_by_ethdev(mae->switch_domain_id,