Skip to content

Commit

Permalink
[PATCH] drivers/eisa: kmalloc + memset -> kzalloc conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak Saxena <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Deepak Saxena authored and Linus Torvalds committed Nov 7, 2005
1 parent e66860c commit 8ac5436
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/eisa/eisa-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,11 @@ static int __init eisa_probe (struct eisa_root_device *root)
/* First try to get hold of slot 0. If there is no device
* here, simply fail, unless root->force_probe is set. */

if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
printk (KERN_ERR "EISA: Couldn't allocate mainboard slot\n");
return -ENOMEM;
}

memset (edev, 0, sizeof (*edev));

if (eisa_request_resources (root, edev, 0)) {
printk (KERN_WARNING \
"EISA: Cannot allocate resource for mainboard\n");
Expand Down Expand Up @@ -317,13 +315,11 @@ static int __init eisa_probe (struct eisa_root_device *root)
force_probe:

for (c = 0, i = 1; i <= root->slots; i++) {
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
printk (KERN_ERR "EISA: Out of memory for slot %d\n",
i);
continue;
}

memset (edev, 0, sizeof (*edev));

if (eisa_request_resources (root, edev, i)) {
printk (KERN_WARNING \
Expand Down

0 comments on commit 8ac5436

Please sign in to comment.