summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authornjoly <njoly@NetBSD.org>2009-06-18 20:36:28 +0000
committernjoly <njoly@NetBSD.org>2009-06-18 20:36:28 +0000
commit9edecd8c076327215e006dcfb24fffffc863d7ec (patch)
tree50004039004710a451887db5526be22c27bc3c03 /sys/compat/linux
parented742f571887a323bf70da24218a75e1c0f9df74 (diff)
In linux_sys_sched_getaffinity(), do not leak memory on error.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/common/linux_sched.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/compat/linux/common/linux_sched.c b/sys/compat/linux/common/linux_sched.c
index 05852fa7de8..97d73cc2d4b 100644
--- a/sys/compat/linux/common/linux_sched.c
+++ b/sys/compat/linux/common/linux_sched.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sched.c,v 1.58 2008/10/25 23:38:28 christos Exp $ */
+/* $NetBSD: linux_sched.c,v 1.59 2009/06/18 20:36:28 njoly Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.58 2008/10/25 23:38:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.59 2009/06/18 20:36:28 njoly Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -646,12 +646,11 @@ linux_sys_sched_getaffinity(struct lwp *l, const struct linux_sys_sched_getaffin
retp = (int *)&data[SCARG(uap, len) - sizeof(ret)];
*retp = ret;
- if ((error = copyout(data, SCARG(uap, mask), SCARG(uap, len))) != 0)
- return error;
+ error = copyout(data, SCARG(uap, mask), SCARG(uap, len));
free(data, M_TEMP);
- return 0;
+ return error;
}