summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_linker.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 23051c4..52eac0f 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -796,15 +796,17 @@ int
kldload(struct thread *td, struct kldload_args *uap)
{
char *pathname = NULL;
- int error;
+ int error, fileid;
td->td_retval[0] = -1;
pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
error = copyinstr(uap->file, pathname, MAXPATHLEN, NULL);
- if (error == 0)
- error = kern_kldload(td, pathname, &td->td_retval[0]);
-
+ if (error == 0) {
+ error = kern_kldload(td, pathname, &fileid);
+ if (error == 0)
+ td->td_retval[0] = fileid;
+ }
free(pathname, M_TEMP);
return (error);
}
OpenPOWER on IntegriCloud