Skip to content

Commit

Permalink
ieee802154: fix error return code in ieee802154_llsec_getparams()
Browse files Browse the repository at this point in the history
Fix to return negative error code -ENOBUFS from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 3e9c156 ("ieee802154: add netlink interfaces for llsec")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stefan Schmidt <[email protected]>
  • Loading branch information
Wei Yongjun authored and Stefan-Schmidt committed Jun 3, 2021
1 parent 79c6b8e commit 373e864
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ieee802154/nl-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) ||
nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
be32_to_cpu(params.frame_counter)) ||
ieee802154_llsec_fill_key_id(msg, &params.out_key))
ieee802154_llsec_fill_key_id(msg, &params.out_key)) {
rc = -ENOBUFS;
goto out_free;
}

dev_put(dev);

Expand Down

0 comments on commit 373e864

Please sign in to comment.