Module Name: src Committed By: jdc Date: Sat Nov 24 20:53:13 UTC 2012
Modified Files: src/sys/arch/arm/marvell [netbsd-6]: mvsocgpp.c Log Message: Pull up revision 1.5 (requested by msaitoh in ticket #713). Fix a uvm_fault panic that memory is not allocated for the last few GPIO bits. To generate a diff of this commit: cvs rdiff -u -r1.3.8.1 -r1.3.8.2 src/sys/arch/arm/marvell/mvsocgpp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/marvell/mvsocgpp.c diff -u src/sys/arch/arm/marvell/mvsocgpp.c:1.3.8.1 src/sys/arch/arm/marvell/mvsocgpp.c:1.3.8.2 --- src/sys/arch/arm/marvell/mvsocgpp.c:1.3.8.1 Tue Oct 23 19:50:49 2012 +++ src/sys/arch/arm/marvell/mvsocgpp.c Sat Nov 24 20:53:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mvsocgpp.c,v 1.3.8.1 2012/10/23 19:50:49 riz Exp $ */ +/* $NetBSD: mvsocgpp.c,v 1.3.8.2 2012/11/24 20:53:13 jdc Exp $ */ /* * Copyright (c) 2008, 2010 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.3.8.1 2012/10/23 19:50:49 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.3.8.2 2012/11/24 20:53:13 jdc Exp $"); #include "gpio.h" @@ -168,7 +168,8 @@ mvsocgpp_attach(device_t parent, device_ MVSOCGPP_WRITE(sc, MVSOCGPP_GPIOIC(i), 0); sc->sc_pic = - kmem_zalloc(sizeof(struct mvsocgpp_pic) * gpp_npins / 8, KM_SLEEP); + kmem_zalloc(sizeof(struct mvsocgpp_pic) * howmany(gpp_npins, 8), + KM_SLEEP); for (i = 0, j = 0; i < gpp_npins; i += 8, j++) { gpio_pic = &(sc->sc_pic + j)->gpio_pic; gpio_pic->pic_ops = &gpio_pic_ops;