struct rtl8366rb *rtl = sw_to_rtl8366rb(dev);
char *buf = rtl->buf;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
memset(buf, '\0', sizeof(rtl->buf));
struct switch_port *port;
int i;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366rb_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);
struct switch_port *port;
int i;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366rb_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);
struct rtl8366s *rtl = sw_to_rtl8366s(dev);
char *buf = rtl->buf;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
memset(buf, '\0', sizeof(rtl->buf));
struct switch_port *port;
int i;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366s_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);
struct switch_port *port;
int i;
- if (val->port_vlan >= RTL8366_NUM_VLANS)
+ if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366s_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);