Skip to content

Commit e9faf53

Browse files
mudongliangStefan-Schmidt
authored andcommitted
ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi
Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF. Fixes: f25da51 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/r/20210705131321.217111-1-mudongliangabcd@gmail.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
1 parent be7f62e commit e9faf53

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ieee802154/mac802154_hwsim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,14 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info)
528528
u32 v0, v1;
529529
u8 lqi;
530530

531-
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
531+
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
532532
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
533533
return -EINVAL;
534534

535535
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
536536
return -EINVAL;
537537

538-
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] &&
538+
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] ||
539539
!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_LQI])
540540
return -EINVAL;
541541

0 commit comments

Comments
 (0)