Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

autofs4 - autofs4_catatonic_mode(): remove redundant null check on kfree()

smatch analysis:

fs/autofs4/waitq.c:46 autofs4_catatonic_mode() info: redundant null check on wq->name.name calling kfree()

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: autofs@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Tim Gardner and committed by
Linus Torvalds
5140a8ce 9d8072e7

+2 -4
+2 -4
fs/autofs4/waitq.c
··· 42 42 while (wq) { 43 43 nwq = wq->next; 44 44 wq->status = -ENOENT; /* Magic is gone - report failure */ 45 - if (wq->name.name) { 46 - kfree(wq->name.name); 47 - wq->name.name = NULL; 48 - } 45 + kfree(wq->name.name); 46 + wq->name.name = NULL; 49 47 wq->wait_ctr--; 50 48 wake_up_interruptible(&wq->queue); 51 49 wq = nwq;