mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 15:47:22 +00:00
lib: make rcu_free() NULL-safe
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
420dcec358
commit
9fe602a17c
@ -139,6 +139,8 @@ extern void rcu_enqueue(struct rcu_head *head, const struct rcu_action *action);
|
|||||||
#define rcu_free(mtype, ptr, field) \
|
#define rcu_free(mtype, ptr, field) \
|
||||||
do { \
|
do { \
|
||||||
typeof(ptr) _ptr = (ptr); \
|
typeof(ptr) _ptr = (ptr); \
|
||||||
|
if (!_ptr) \
|
||||||
|
break; \
|
||||||
struct rcu_head *_rcu_head = &_ptr->field; \
|
struct rcu_head *_rcu_head = &_ptr->field; \
|
||||||
static const struct rcu_action _rcu_action = { \
|
static const struct rcu_action _rcu_action = { \
|
||||||
.type = RCUA_FREE, \
|
.type = RCUA_FREE, \
|
||||||
|
Loading…
Reference in New Issue
Block a user