diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-12-06 23:32:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:22 -0500 |
commit | a120586873d3d64de93bd6d593d237e131994e58 (patch) | |
tree | ae284884e23268e867f748a2ab52353cf2390e89 /net/ipv6 | |
parent | b30973f877fea1a3fb84e05599890fcc082a88e5 (diff) |
[PATCH] Allow NULL pointers in percpu_free
The patch (as824b) makes percpu_free() ignore NULL arguments, as one would
expect for a deallocation routine. (Note that free_percpu is #defined as
percpu_free in include/linux/percpu.h.) A few callers are updated to remove
now-unneeded tests for NULL. A few other callers already seem to assume
that passing a NULL pointer to percpu_free() is okay!
The patch also removes an unnecessary NULL check in percpu_depopulate().
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/af_inet6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 87c8f54872b7..e5cd83b2205d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -720,10 +720,8 @@ snmp6_mib_free(void *ptr[2]) | |||
720 | { | 720 | { |
721 | if (ptr == NULL) | 721 | if (ptr == NULL) |
722 | return; | 722 | return; |
723 | if (ptr[0]) | 723 | free_percpu(ptr[0]); |
724 | free_percpu(ptr[0]); | 724 | free_percpu(ptr[1]); |
725 | if (ptr[1]) | ||
726 | free_percpu(ptr[1]); | ||
727 | ptr[0] = ptr[1] = NULL; | 725 | ptr[0] = ptr[1] = NULL; |
728 | } | 726 | } |
729 | 727 | ||