Messages in this thread | | | Date | Tue, 9 Apr 2019 03:04:36 -0700 | From | Christoph Hellwig <> | Subject | Re: [PATCH 01/18] drivers core: Add I/O ASID allocator |
| |
On Tue, Apr 09, 2019 at 01:00:49PM +0300, Andriy Shevchenko wrote: > I think it makes sense to add a helper macro to rcupdate.h > (and we have several cases in kernel that can utilize it) > > #define kfree_non_null_rcu(ptr, rcu_head) \ > do { \ > if (ptr) \ > kfree_rcu(ptr, rcu_head); \ > } while (0) > > as a more common pattern for resource deallocators.
I think that should move straight into kfree_rcu. In general we expect *free* to deal with NULL pointers transparently, so we should do so here as well.
| |