_port_ is already known to be a valid index in the callers [1]. So
these checks are unnecessary.
[1] https://lkml.org/lkml/2018/2/16/469
Addresses-Coverity-ID:
1465287
Addresses-Coverity-ID:
1465291
Suggested-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
if (!chip->info->ptp_support)
return -EOPNOTSUPP;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return -EINVAL;
-
if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
return -EFAULT;
if (!chip->info->ptp_support)
return -EOPNOTSUPP;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return -EINVAL;
-
return copy_to_user(ifr->ifr_data, config, sizeof(*config)) ?
-EFAULT : 0;
}
if (!chip->info->ptp_support)
return NULL;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return NULL;
-
hdr = parse_ptp_header(skb, type);
if (!hdr)
return NULL;