summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-06-20 19:32:10 +0000
committerjhb <jhb@FreeBSD.org>2006-06-20 19:32:10 +0000
commitc6a767184d44e40fb3cbb38db884766bf76a2191 (patch)
treee66cc3a1a82578b3cc25e5789d8981e3a4eca802 /sys/kern/kern_linker.c
parent7e90b114e30399ce713a2dcdacb93865417eac34 (diff)
downloadFreeBSD-src-c6a767184d44e40fb3cbb38db884766bf76a2191.zip
FreeBSD-src-c6a767184d44e40fb3cbb38db884766bf76a2191.tar.gz
- Remove some useless variable initializations.
- Make some conditional free()'s where the condition was always true unconditional.
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r--sys/kern/kern_linker.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 52eac0f..50e22cd 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);
}
OpenPOWER on IntegriCloud