diff options
| -rw-r--r-- | net/ieee802154/nl-phy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index c9dfd6f59e34..222310a07762 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c | |||
| @@ -436,8 +436,7 @@ static int phy_set_csma_params(struct wpan_phy *phy, struct genl_info *info) | |||
| 436 | if (info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]) | 436 | if (info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]) |
| 437 | max_be = nla_get_u8(info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]); | 437 | max_be = nla_get_u8(info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]); |
| 438 | 438 | ||
| 439 | if (retries > 5 || max_be > 8 || min_be > max_be || | 439 | if (retries > 5 || max_be < 3 || max_be > 8 || min_be > max_be) |
| 440 | retries < -1 || retries > 7) | ||
| 441 | return -EINVAL; | 440 | return -EINVAL; |
| 442 | 441 | ||
| 443 | rc = phy->set_csma_params(phy, min_be, max_be, retries); | 442 | rc = phy->set_csma_params(phy, min_be, max_be, retries); |
| @@ -456,6 +455,9 @@ static int phy_set_frame_retries(struct wpan_phy *phy, struct genl_info *info) | |||
| 456 | s8 retries = nla_get_s8(info->attrs[IEEE802154_ATTR_FRAME_RETRIES]); | 455 | s8 retries = nla_get_s8(info->attrs[IEEE802154_ATTR_FRAME_RETRIES]); |
| 457 | int rc; | 456 | int rc; |
| 458 | 457 | ||
| 458 | if (retries < -1 || retries > 7) | ||
| 459 | return -EINVAL; | ||
| 460 | |||
| 459 | rc = phy->set_frame_retries(phy, retries); | 461 | rc = phy->set_frame_retries(phy, retries); |
| 460 | if (rc < 0) | 462 | if (rc < 0) |
| 461 | return rc; | 463 | return rc; |
