Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186798
b: refs/heads/master
c: 33e920d
h: refs/heads/master
v: v3
  • Loading branch information
Arthur Benilov authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 5487c94 commit 48cf58c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5188d74cc4597a63a0907b8996ca0a2d36f1b970
refs/heads/master: 33e920d9ebaddbc9cf51cf6e1de7baa8d7b8d6dd
14 changes: 14 additions & 0 deletions trunk/drivers/staging/vme/devices/vme_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
"resource\n");
goto err_master;
}
image[i].size_buf = PCI_BUF_SIZE;
image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
if (image[i].kern_buf == NULL) {
printk(KERN_WARNING "Unable to allocate memory for "
"master window buffers\n");
err = -ENOMEM;
goto err_master_buf;
}
}

/* Create sysfs entries - on udev systems this creates the dev files */
Expand Down Expand Up @@ -791,6 +799,9 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)

/* Ensure counter set correcty to unalloc all master windows */
i = MASTER_MAX + 1;
err_master_buf:
for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++)
kfree(image[i].kern_buf);
err_master:
while (i > MASTER_MINOR) {
i--;
Expand Down Expand Up @@ -826,6 +837,9 @@ static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
}
class_destroy(vme_user_sysfs_class);

for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++)
kfree(image[i].kern_buf);

for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
vme_slave_free(image[i].resource);
Expand Down

0 comments on commit 48cf58c

Please sign in to comment.