mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b30973f877
commit
a120586873
4 changed files with 10 additions and 14 deletions
|
|
@ -720,10 +720,8 @@ snmp6_mib_free(void *ptr[2])
|
|||
{
|
||||
if (ptr == NULL)
|
||||
return;
|
||||
if (ptr[0])
|
||||
free_percpu(ptr[0]);
|
||||
if (ptr[1])
|
||||
free_percpu(ptr[1]);
|
||||
free_percpu(ptr[0]);
|
||||
free_percpu(ptr[1]);
|
||||
ptr[0] = ptr[1] = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue