From de310fa8ecd2b457e0bdcbe621191a25b69a6e09 Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Mon, 19 Aug 2013 18:36:53 +0300 Subject: [PATCH] compat: Avoid rcu_dereference_protected and kfree_rcu redefinition bug: 2421 Signed-off-by: Vladimir Sokolovsky --- include/linux/compat-2.6.34.h | 8 ++++++-- include/linux/compat-3.0.h | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h index 2035e35..dc1539d 100644 --- a/include/linux/compat-2.6.34.h +++ b/include/linux/compat-2.6.34.h @@ -287,11 +287,15 @@ static inline int usb_enable_autosuspend(struct usb_device *udev) static inline int usb_disable_autosuspend(struct usb_device *udev) { return 0; } -#ifndef CONFIG_COMPAT_RHEL_6_4 +#ifndef rcu_dereference_protected #define rcu_dereference_protected(p, c) (p) +#endif +#ifndef rcu_access_pointer #define rcu_access_pointer(p) ACCESS_ONCE(p) +#endif +#ifndef rcu_dereference_raw #define rcu_dereference_raw(p) rcu_dereference(p) -#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#endif #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ diff --git a/include/linux/compat-3.0.h b/include/linux/compat-3.0.h index 85dbace..f307974 100644 --- a/include/linux/compat-3.0.h +++ b/include/linux/compat-3.0.h @@ -81,7 +81,9 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t { return kstrtoint_from_user(s, count, base, res); } +#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#ifndef kfree_rcu /* * This adds a nested function everywhere kfree_rcu() was called. This * function frees the memory and is given as a function to call_rcu(). @@ -97,7 +99,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t } \ call_rcu(&(data)->rcuhead, __kfree_rcu_fn); \ } while (0) -#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#endif #ifdef MODULE -- 2.46.0