[NET_SCHED]: Propagate nla_parse return value
nla_parse() returns more detailed errno codes, propagate them back on
error.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index e587391..aaa32a2 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -223,8 +223,12 @@
*/
if (flow)
return -EBUSY;
- if (opt == NULL || nla_parse_nested(tb, TCA_ATM_MAX, opt, NULL))
+ if (opt == NULL)
return -EINVAL;
+ error = nla_parse_nested(tb, TCA_ATM_MAX, opt, NULL);
+ if (error < 0)
+ return error;
+
if (!tb[TCA_ATM_FD] || nla_len(tb[TCA_ATM_FD]) < sizeof(fd))
return -EINVAL;
fd = *(int *)nla_data(tb[TCA_ATM_FD]);