ieee802154: fix error return code in ieee802154_llsec_getparams()
[ Upstream commit373e864cf5] Fix to return negative error code -ENOBUFS from the error handling case instead of 0, as done elsewhere in this function. Fixes:3e9c156e2c("ieee802154: add netlink interfaces for llsec") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20210519141614.3040055-1-weiyongjun1@huawei.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2a0ba0125c
commit
e513d88962
1 changed files with 3 additions and 1 deletions
|
|
@ -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, ¶ms.out_key))
|
||||
ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) {
|
||||
rc = -ENOBUFS;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
dev_put(dev);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue