mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 20:58:14 -04:00
staging: unisys: Use kzalloc instead of kmalloc/memset
This patch turns a kmalloc/memset into an equivalent kzalloc. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d253058f49
commit
0aa5ae1e2e
@@ -281,12 +281,11 @@ devmajorminor_create_file(struct visor_device *dev, const char *name,
|
||||
rc = -ENOMEM;
|
||||
goto away;
|
||||
}
|
||||
myattr = kmalloc(sizeof(*myattr), GFP_KERNEL);
|
||||
myattr = kzalloc(sizeof(*myattr), GFP_KERNEL);
|
||||
if (!myattr) {
|
||||
rc = -ENOMEM;
|
||||
goto away;
|
||||
}
|
||||
memset(myattr, 0, sizeof(struct devmajorminor_attribute));
|
||||
myattr->show = DEVMAJORMINOR_ATTR;
|
||||
myattr->store = NULL;
|
||||
myattr->slot = slot;
|
||||
|
||||
Reference in New Issue
Block a user