From c42b63359e9aef42ca34c2d42e67ad353acaf9d1 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 16 Sep 2013 12:30:42 +0300 Subject: [PATCH] container_of: people checking the return value of nla_data() are wrong There is no way that checking the return value of nla_data() makes sense. People sometimes check it out of a reflex for checking every return value which is normally harmless. But sometimes they actually intended to check something else and it leads to a bad dereference. Signed-off-by: Dan Carpenter --- check_container_of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/check_container_of.c b/check_container_of.c index c07799eb..2109499e 100644 --- a/check_container_of.c +++ b/check_container_of.c @@ -54,6 +54,7 @@ void check_container_of(int id) my_id = id; add_macro_assign_hook("container_of", &match_non_null, NULL); add_macro_assign_hook("list_first_entry", &match_non_null, NULL); + add_function_assign_hook("nla_data", &match_non_null, NULL); add_modification_hook(my_id, &is_ok); add_hook(&match_condition, CONDITION_HOOK); } -- 2.11.4.GIT