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:
parent
d253058f49
commit
0aa5ae1e2e
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue