Message ID | 20160217224415.GA3866@jcartwri.amer.corp.natinst.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Feb 17, 2016 at 11:44 PM, Josh Cartwright <joshc@ni.com> wrote: > Here's a properly cooked patch. Otherwise, feel free to squash it in if > it's easier for you. > > -- 8< -- > Subject: [PATCH] gpio: use kzalloc to allocate gpio_device Patch applied, of course. Big hugs and thanks for fixing my stupid mistake! NĂ³ras, Linus Walleij
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d8511cd..59f0045 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -435,7 +435,7 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) * First: allocate and populate the internal stat container, and * set up the struct device. */ - gdev = kmalloc(sizeof(*gdev), GFP_KERNEL); + gdev = kzalloc(sizeof(*gdev), GFP_KERNEL); if (!gdev) return -ENOMEM; gdev->dev.bus = &gpio_bus_type;