[PATCH] NET: catch signed nla_len() retval in tcf_simp_init()

From: Roel Kluin
Date: Wed Apr 16 2008 - 23:33:39 EST


'datalen' is unsigned, use 'ret' instead to catch a negative return value.

Signed-off-by: Roel Kluin <12o3l@xxxxxxxxxx>
---
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index fbde461..b78d015 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -114,9 +114,10 @@ static int tcf_simp_init(struct nlattr *nla, struct nlattr *est,
if (defdata == NULL)
return -EINVAL;

- datalen = nla_len(tb[TCA_DEF_DATA]);
- if (datalen <= 0)
+ ret = nla_len(tb[TCA_DEF_DATA]);
+ if (ret <= 0)
return -EINVAL;
+ datalen = ret;

pc = tcf_hash_check(parm->index, a, bind, &simp_hash_info);
if (!pc) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/