projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fda4c0
)
batman-adv: Fix possible side-effects in _batadv_dbg
author
Sven Eckelmann
<sven@narfation.org>
Wed, 22 Feb 2017 16:16:41 +0000
(17:16 +0100)
committer
Simon Wunderlich
<sw@simonwunderlich.de>
Thu, 16 Mar 2017 20:14:52 +0000
(21:14 +0100)
An argument of a macro should not be evaluated multiple times. Otherwise
embedded operations in these arguments will be executed multiple times.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/log.h
patch
|
blob
|
history
diff --git
a/net/batman-adv/log.h
b/net/batman-adv/log.h
index
7a2b9f4
..
65ce97e
100644
(file)
--- a/
net/batman-adv/log.h
+++ b/
net/batman-adv/log.h
@@
-73,9
+73,10
@@
__printf(2, 3);
/* possibly ratelimited debug output */
#define _batadv_dbg(type, bat_priv, ratelimited, fmt, arg...) \
do { \
- if (atomic_read(&(bat_priv)->log_level) & (type) && \
+ struct batadv_priv *__batpriv = (bat_priv); \
+ if (atomic_read(&__batpriv->log_level) & (type) && \
(!(ratelimited) || net_ratelimit())) \
- batadv_debug_log(
bat_priv, fmt, ## arg);
\
+ batadv_debug_log(
__batpriv, fmt, ## arg);
\
} \
while (0)
#else /* !CONFIG_BATMAN_ADV_DEBUG */