diff options
author | Alexander Aring <aar@pengutronix.de> | 2016-02-26 03:06:07 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-02-26 03:08:15 -0500 |
commit | 2306f65637079c8922aec15b4ced75ea457e757b (patch) | |
tree | 059f638c4e1e1a3b38a5748e137cd0e47ce4d900 | |
parent | 395174bb07c1dce58fbf2baa3a01bb69f5103c59 (diff) |
6lowpan: iphc: fix invalid case handling
This patch fixes the return value in a case which should never occur.
Instead returning "-EINVAL" we return LOWPAN_IPHC_DAM_00 which is
invalid on context based addresses. Also change the WARN_ON_ONCE to
WARN_ONCE which was suggested by Dan Carpenter.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/6lowpan/iphc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index 06287ac03211..72172514fea0 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c | |||
@@ -811,8 +811,8 @@ static u8 lowpan_compress_ctx_addr(u8 **hc_ptr, const struct in6_addr *ipaddr, | |||
811 | goto out; | 811 | goto out; |
812 | } | 812 | } |
813 | 813 | ||
814 | WARN_ON_ONCE("context found but no address mode matched\n"); | 814 | WARN_ONCE(1, "context found but no address mode matched\n"); |
815 | return -EINVAL; | 815 | return LOWPAN_IPHC_DAM_00; |
816 | out: | 816 | out: |
817 | 817 | ||
818 | if (sam) | 818 | if (sam) |