Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336542
b: refs/heads/master
c: 2d56b10
h: refs/heads/master
v: v3
  • Loading branch information
Denis Kirjanov authored and Borislav Petkov committed Nov 28, 2012
1 parent d02243a commit 0f4cfba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5c6770d4cb27bc33aa433cf8fb848ad9af6644b
refs/heads/master: 2d56b109e3a50cf316e60f07541bbeb1d8fe251a
17 changes: 15 additions & 2 deletions trunk/drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,15 @@ int __init edac_mc_sysfs_init(void)
edac_subsys = edac_get_sysfs_subsys();
if (edac_subsys == NULL) {
edac_dbg(1, "no edac_subsys\n");
return -EINVAL;
err = -EINVAL;
goto out;
}

mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL);
if (!mci_pdev) {
err = -ENOMEM;
goto out_put_sysfs;
}

mci_pdev->bus = edac_subsys;
mci_pdev->type = &mc_attr_type;
Expand All @@ -1138,16 +1143,24 @@ int __init edac_mc_sysfs_init(void)

err = device_add(mci_pdev);
if (err < 0)
return err;
goto out_dev_free;

edac_dbg(0, "device %s created\n", dev_name(mci_pdev));

return 0;

out_dev_free:
kfree(mci_pdev);
out_put_sysfs:
edac_put_sysfs_subsys();
out:
return err;
}

void __exit edac_mc_sysfs_exit(void)
{
put_device(mci_pdev);
device_del(mci_pdev);
edac_put_sysfs_subsys();
kfree(mci_pdev);
}

0 comments on commit 0f4cfba

Please sign in to comment.