summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorSimon Horman <simon.horman@netronome.com>2018-06-27 07:39:34 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-29 17:50:26 +0300
commita1165b591925551d7c8f1ed45484ebc2847ec8fa (patch)
tree166dca63ebaed139bc2087dd54e17263c7d21e24 /net/sched
parentc90d160487c4f82ba128730bcbaf7da760c5bdf1 (diff)
downloadlinux-a1165b591925551d7c8f1ed45484ebc2847ec8fa.tar.xz
net/sched: act_tunnel_key: disambiguate metadata dst error cases
Metadata may be NULL for one of two reasons: * Missing user input * Failure to allocate the metadata dst Disambiguate these case by returning -EINVAL for the former and -ENOMEM for the latter rather than -EINVAL for both cases. This is in preparation for using extended ack to provide more information to users when parsing their input. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_tunnel_key.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
index 626dac81a48a..2edd389e7c92 100644
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@ -143,10 +143,13 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
metadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, dst_port,
0, flags,
key_id, 0);
+ } else {
+ ret = -EINVAL;
+ goto err_out;
}
if (!metadata) {
- ret = -EINVAL;
+ ret = -ENOMEM;
goto err_out;
}