diff options
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/google/gsmi.c | 19 | ||||
-rw-r--r-- | drivers/firmware/iscsi_ibft.c | 14 | ||||
-rw-r--r-- | drivers/firmware/sigma.c | 3 |
3 files changed, 27 insertions, 9 deletions
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index fa7f0b3e81dd..68810fd1a59d 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -869,8 +869,6 @@ static __init int gsmi_init(void) goto out_err; } - printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n"); - /* Register in the firmware directory */ ret = -ENOMEM; gsmi_kobj = kobject_create_and_add("gsmi", firmware_kobj); @@ -890,12 +888,13 @@ static __init int gsmi_init(void) ret = sysfs_create_files(gsmi_kobj, gsmi_attrs); if (ret) { printk(KERN_INFO "gsmi: Failed to add attrs"); - goto out_err; + goto out_remove_bin_file; } - if (register_efivars(&efivars, &efivar_ops, gsmi_kobj)) { + ret = register_efivars(&efivars, &efivar_ops, gsmi_kobj); + if (ret) { printk(KERN_INFO "gsmi: Failed to register efivars\n"); - goto out_err; + goto out_remove_sysfs_files; } register_reboot_notifier(&gsmi_reboot_notifier); @@ -903,9 +902,15 @@ static __init int gsmi_init(void) atomic_notifier_chain_register(&panic_notifier_list, &gsmi_panic_notifier); + printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n"); + return 0; - out_err: +out_remove_sysfs_files: + sysfs_remove_files(gsmi_kobj, gsmi_attrs); +out_remove_bin_file: + sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr); +out_err: kobject_put(gsmi_kobj); gsmi_buf_free(gsmi_dev.param_buf); gsmi_buf_free(gsmi_dev.data_buf); @@ -925,6 +930,8 @@ static void __exit gsmi_exit(void) &gsmi_panic_notifier); unregister_efivars(&efivars); + sysfs_remove_files(gsmi_kobj, gsmi_attrs); + sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr); kobject_put(gsmi_kobj); gsmi_buf_free(gsmi_dev.param_buf); gsmi_buf_free(gsmi_dev.data_buf); diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index ce33f4626957..c811cb107904 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -566,6 +566,11 @@ static mode_t __init ibft_check_initiator_for(void *data, int type) return rc; } +static void ibft_kobj_release(void *data) +{ + kfree(data); +} + /* * Helper function for ibft_register_kobjects. */ @@ -595,7 +600,8 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header, boot_kobj = iscsi_boot_create_initiator(boot_kset, hdr->index, ibft_kobj, ibft_attr_show_initiator, - ibft_check_initiator_for); + ibft_check_initiator_for, + ibft_kobj_release); if (!boot_kobj) { rc = -ENOMEM; goto free_ibft_obj; @@ -610,7 +616,8 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header, boot_kobj = iscsi_boot_create_ethernet(boot_kset, hdr->index, ibft_kobj, ibft_attr_show_nic, - ibft_check_nic_for); + ibft_check_nic_for, + ibft_kobj_release); if (!boot_kobj) { rc = -ENOMEM; goto free_ibft_obj; @@ -625,7 +632,8 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header, boot_kobj = iscsi_boot_create_target(boot_kset, hdr->index, ibft_kobj, ibft_attr_show_target, - ibft_check_tgt_for); + ibft_check_tgt_for, + ibft_kobj_release); if (!boot_kobj) { rc = -ENOMEM; goto free_ibft_obj; diff --git a/drivers/firmware/sigma.c b/drivers/firmware/sigma.c index c19cd2c39fa6..f10fc521951b 100644 --- a/drivers/firmware/sigma.c +++ b/drivers/firmware/sigma.c @@ -11,6 +11,7 @@ #include <linux/firmware.h> #include <linux/kernel.h> #include <linux/i2c.h> +#include <linux/module.h> #include <linux/sigma.h> /* Return: 0==OK, <0==error, =1 ==no more actions */ @@ -113,3 +114,5 @@ int process_sigma_firmware(struct i2c_client *client, const char *name) return ret; } EXPORT_SYMBOL(process_sigma_firmware); + +MODULE_LICENSE("GPL"); |