Use NULL rather than 0 to invalidate a pointer.
Rather than duplicating the LLE_FREE_LOCKED() macro code in LLE_FREE(), call it directly (like we do for the RT_* macros). Sponsored by: ISPsystem [1] Reviewed by: julian [1] MFC After: 1 week [1] Early 2010.
This commit is contained in:
parent
f95308351b
commit
962be6dfb3
@ -116,19 +116,12 @@ struct llentry {
|
||||
LLE_WUNLOCK(lle); \
|
||||
} \
|
||||
/* guard against invalid refs */ \
|
||||
lle = 0; \
|
||||
lle = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define LLE_FREE(lle) do { \
|
||||
LLE_WLOCK(lle); \
|
||||
if ((lle)->lle_refcnt <= 1) \
|
||||
(lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\
|
||||
else { \
|
||||
(lle)->lle_refcnt--; \
|
||||
LLE_WUNLOCK(lle); \
|
||||
} \
|
||||
/* guard against invalid refs */ \
|
||||
lle = NULL; \
|
||||
LLE_FREE_LOCKED(lle); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user