summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-04-26 08:58:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-26 09:17:34 +0200
commit227abcc6da7b803e380f034d6772ea0861612340 (patch)
treeda31117a7adf47048b796df3c7fb0fac3962824d /include/linux/kernel.h
parent2bbdd81567c6113e1aa929080365084e31422d02 (diff)
staging: kernel.h: Prevent macro expantion bug in container_of_safe()
There aren't many users of this so it doesn't cause a problem, but we obviously want to use "__mptr" here instead of "ptr" to prevent the parameter from being executed twice. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 58d6645b1425..3dfa3f260fc4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -977,7 +977,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
!__same_type(*(ptr), void), \
"pointer type mismatch in container_of()"); \
- IS_ERR_OR_NULL(ptr) ? ERR_CAST(ptr) : \
+ IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \
((type *)(__mptr - offsetof(type, member))); })
/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */