mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 20:22:13 +08:00
net: ieee802154: Return meaningful error codes from the netlink helpers
commit79c37ca73a
upstream. Returning -1 does not indicate anything useful. Use a standard and meaningful error code instead. Fixes:a26c5fd762
("nl802154: add support for security layer") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/r/20220125121426.848337-6-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6f38d3a6ec
commit
dc8c2f0d01
@ -1457,7 +1457,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@ -1650,7 +1650,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@ -1828,7 +1828,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@ -2004,7 +2004,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
|
Loading…
Reference in New Issue
Block a user