diff options
| author | ad <ad@NetBSD.org> | 2008-04-23 13:13:25 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2008-04-23 13:13:25 +0000 |
| commit | ce69e3e9c8ef65e92845c8ca4575c34bc5bcc11d (patch) | |
| tree | 5a8e7ffa8035194517c4cdfdd2d49d12ed5bef90 /sys/compat/linux/common/linux_socket.c | |
| parent | d0466d413e2cd47a5db94c22d780294ea154e6d9 (diff) | |
Fix locking.
Diffstat (limited to 'sys/compat/linux/common/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/common/linux_socket.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c index c3babae34a7..14bcabeb7ec 100644 --- a/sys/compat/linux/common/linux_socket.c +++ b/sys/compat/linux/common/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.89 2008/03/26 20:08:22 ad Exp $ */ +/* $NetBSD: linux_socket.c,v 1.90 2008/04/23 13:13:25 ad Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.89 2008/03/26 20:08:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.90 2008/04/23 13:13:25 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1000,6 +1000,8 @@ linux_getifhwaddr(struct lwp *l, register_t *retval, u_int fd, if ((fp = fd_getfile(fd)) == NULL) return (EBADF); + KERNEL_LOCK(1, NULL); + if ((fp->f_flag & (FREAD | FWRITE)) == 0) { error = EBADF; goto out; @@ -1084,6 +1086,7 @@ linux_getifhwaddr(struct lwp *l, register_t *retval, u_int fd, } out: + KERNEL_UNLOCK_ONE(NULL); fd_putfile(fd); return error; } |
