net: genetlink: return the error code when attribute parsing fails.
Currently if attribute parsing fails and the genl family does not support parallel operation, the error code returned by __nlmsg_parse() is discarded by genl_family_rcv_msg_attrs_parse(). Be sure to report the error for all genl families. Fixes:c10e6cf85e
("net: genetlink: push attrbuf allocation and parsing to a separate function") Fixes:ab5b526da0
("net: genetlink: always allocate separate attrs for dumpit ops") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3e72dfdf82
commit
39f3b41aa7
@ -497,8 +497,9 @@ genl_family_rcv_msg_attrs_parse(const struct genl_family *family,
|
|||||||
|
|
||||||
err = __nlmsg_parse(nlh, hdrlen, attrbuf, family->maxattr,
|
err = __nlmsg_parse(nlh, hdrlen, attrbuf, family->maxattr,
|
||||||
family->policy, validate, extack);
|
family->policy, validate, extack);
|
||||||
if (err && parallel) {
|
if (err) {
|
||||||
kfree(attrbuf);
|
if (parallel)
|
||||||
|
kfree(attrbuf);
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
return attrbuf;
|
return attrbuf;
|
||||||
|
Loading…
Reference in New Issue
Block a user