From 73a2437a83202bb2d0b4fa167ac10c83d668e2bf Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 20 Jun 2006 19:32:10 +0000 Subject: [PATCH] - Remove some useless variable initializations. - Make some conditional free()'s where the condition was always true unconditional. --- sys/kern/kern_linker.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 52eac0f7320..50e22cdb1fe 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -345,7 +345,6 @@ linker_load_file(const char *filename, linker_file_t *result) lf->refs++; return (0); } - lf = NULL; foundfile = 0; error = 0; @@ -894,7 +893,7 @@ kldfind(struct thread *td, struct kldfind_args *uap) char *pathname; const char *filename; linker_file_t lf; - int error = 0; + int error; #ifdef MAC error = mac_check_kld_stat(td->td_ucred); @@ -916,8 +915,7 @@ kldfind(struct thread *td, struct kldfind_args *uap) else error = ENOENT; out: - if (pathname) - free(pathname, M_TEMP); + free(pathname, M_TEMP); mtx_unlock(&Giant); return (error); } @@ -1789,8 +1787,7 @@ linker_load_module(const char *kldname, const char *modname, *lfpp = lfdep; } while (0); out: - if (pathname) - free(pathname, M_LINKER); + free(pathname, M_LINKER); return (error); }