Commit 0aa5ae1e authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

staging: unisys: Use kzalloc instead of kmalloc/memset

This patch turns a kmalloc/memset into an equivalent kzalloc.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d253058f
...@@ -281,12 +281,11 @@ devmajorminor_create_file(struct visor_device *dev, const char *name, ...@@ -281,12 +281,11 @@ devmajorminor_create_file(struct visor_device *dev, const char *name,
rc = -ENOMEM; rc = -ENOMEM;
goto away; goto away;
} }
myattr = kmalloc(sizeof(*myattr), GFP_KERNEL); myattr = kzalloc(sizeof(*myattr), GFP_KERNEL);
if (!myattr) { if (!myattr) {
rc = -ENOMEM; rc = -ENOMEM;
goto away; goto away;
} }
memset(myattr, 0, sizeof(struct devmajorminor_attribute));
myattr->show = DEVMAJORMINOR_ATTR; myattr->show = DEVMAJORMINOR_ATTR;
myattr->store = NULL; myattr->store = NULL;
myattr->slot = slot; myattr->slot = slot;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment