mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
cris: arch-v32: gpio: Use kzalloc instead of kmalloc/memset
Turn a kmalloc/memset into an equivalent kzalloc. Doing so also move the zero'ing of the memory outside of a mutex. Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Signed-off-by: Jesper Nilsson <jespern@axis.com>
This commit is contained in:
parent
51e771c0d2
commit
6a4756f695
@ -425,12 +425,11 @@ gpio_open(struct inode *inode, struct file *filp)
|
||||
if (p > GPIO_MINOR_LAST)
|
||||
return -EINVAL;
|
||||
|
||||
priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL);
|
||||
priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&gpio_mutex);
|
||||
memset(priv, 0, sizeof(*priv));
|
||||
|
||||
priv->minor = p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user