patch-2.1.132 linux/arch/arm/kernel/sys_arm.c

Next file: linux/arch/arm/kernel/traps.c
Previous file: linux/arch/arm/kernel/setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/arch/arm/kernel/sys_arm.c linux/arch/arm/kernel/sys_arm.c
@@ -77,7 +77,8 @@
 		goto out;
 	if (!(a.flags & MAP_ANONYMOUS)) {
 		error = -EBADF;
-		if (a.fd >= NR_OPEN || !(file = current->files->fd[a.fd]))
+		if (a.fd >= current->files->max_fds || 
+		    !(file = current->files->fd[a.fd]))
 			goto out;
 	}
 	a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov