- if ((h)->cbh_flags & CBH_FLAG_ATOMIC_GROW) \
- LIBCFS_CPT_ALLOC_GFP((ptr), h->cbh_cptab, h->cbh_cptid, \
- CBH_NOB, GFP_ATOMIC); \
- else \
- LIBCFS_CPT_ALLOC((ptr), h->cbh_cptab, h->cbh_cptid, \
- CBH_NOB); \
+ if (h->cbh_cptab) { \
+ if ((h)->cbh_flags & CBH_FLAG_ATOMIC_GROW) \
+ LIBCFS_CPT_ALLOC_GFP((ptr), h->cbh_cptab, \
+ h->cbh_cptid, CBH_NOB, \
+ GFP_ATOMIC); \
+ else \
+ LIBCFS_CPT_ALLOC((ptr), h->cbh_cptab, \
+ h->cbh_cptid, CBH_NOB); \
+ } else { \
+ if ((h)->cbh_flags & CBH_FLAG_ATOMIC_GROW) \
+ LIBCFS_ALLOC_ATOMIC((ptr), CBH_NOB); \
+ else \
+ LIBCFS_ALLOC((ptr), CBH_NOB); \
+ } \