diff --git a/sys/arch/arm/marvell/mvsocgpp.c b/sys/arch/arm/marvell/mvsocgpp.c index 38564ea14b98..3da6eef5fa31 100644 --- a/sys/arch/arm/marvell/mvsocgpp.c +++ b/sys/arch/arm/marvell/mvsocgpp.c @@ -1,4 +1,4 @@ -/* $NetBSD: mvsocgpp.c,v 1.4 2012/09/10 08:50:37 msaitoh Exp $ */ +/* $NetBSD: mvsocgpp.c,v 1.5 2012/11/21 08:03:18 msaitoh Exp $ */ /* * Copyright (c) 2008, 2010 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.4 2012/09/10 08:50:37 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.5 2012/11/21 08:03:18 msaitoh Exp $"); #include "gpio.h" @@ -168,7 +168,8 @@ mvsocgpp_attach(device_t parent, device_t self, void *aux) 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;