Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-6.6-1' of https://github.com/cminyard/linux-ipmi

Pull IPMI updates from Corey Minyard:
"Minor fixes for IPMI

Lots of small unconnected things, memory leaks on error, a possible
(though unlikely) deadlock, changes for updates to other things that
have changed. Nothing earth-shattering, but things that need update"

* tag 'for-linus-6.6-1' of https://github.com/cminyard/linux-ipmi:
ipmi_si: fix -Wvoid-pointer-to-enum-cast warning
ipmi: fix potential deadlock on &kcs_bmc->lock
ipmi_si: fix a memleak in try_smi_init()
ipmi: Change request_module to request_module_nowait
ipmi: make ipmi_class a static const structure
ipmi:ssif: Fix a memory leak when scanning for an adapter
ipmi:ssif: Add check for kstrdup
dt-bindings: ipmi: aspeed,ast2400-kcs-bmc: drop unneeded quotes
ipmi: Switch i2c drivers back to use .probe()
ipmi_watchdog: Fix read syscall not responding to signals during sleep

+34 -23
+1 -1
drivers/char/ipmi/ipmb_dev_int.c
··· 366 366 .name = "ipmb-dev", 367 367 .acpi_match_table = ACPI_PTR(acpi_ipmb_id), 368 368 }, 369 - .probe_new = ipmb_probe, 369 + .probe = ipmb_probe, 370 370 .remove = ipmb_remove, 371 371 .id_table = ipmb_id, 372 372 };
+12 -12
drivers/char/ipmi/ipmi_devintf.c
··· 807 807 static LIST_HEAD(reg_list); 808 808 static DEFINE_MUTEX(reg_list_mutex); 809 809 810 - static struct class *ipmi_class; 810 + static const struct class ipmi_class = { 811 + .name = "ipmi", 812 + }; 811 813 812 814 static void ipmi_new_smi(int if_num, struct device *device) 813 815 { ··· 824 822 entry->dev = dev; 825 823 826 824 mutex_lock(&reg_list_mutex); 827 - device_create(ipmi_class, device, dev, NULL, "ipmi%d", if_num); 825 + device_create(&ipmi_class, device, dev, NULL, "ipmi%d", if_num); 828 826 list_add(&entry->link, &reg_list); 829 827 mutex_unlock(&reg_list_mutex); 830 828 } ··· 842 840 break; 843 841 } 844 842 } 845 - device_destroy(ipmi_class, dev); 843 + device_destroy(&ipmi_class, dev); 846 844 mutex_unlock(&reg_list_mutex); 847 845 } 848 846 ··· 862 860 863 861 pr_info("ipmi device interface\n"); 864 862 865 - ipmi_class = class_create("ipmi"); 866 - if (IS_ERR(ipmi_class)) { 867 - pr_err("ipmi: can't register device class\n"); 868 - return PTR_ERR(ipmi_class); 869 - } 863 + rv = class_register(&ipmi_class); 864 + if (rv) 865 + return rv; 870 866 871 867 rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops); 872 868 if (rv < 0) { 873 - class_destroy(ipmi_class); 869 + class_unregister(&ipmi_class); 874 870 pr_err("ipmi: can't get major %d\n", ipmi_major); 875 871 return rv; 876 872 } ··· 880 880 rv = ipmi_smi_watcher_register(&smi_watcher); 881 881 if (rv) { 882 882 unregister_chrdev(ipmi_major, DEVICE_NAME); 883 - class_destroy(ipmi_class); 883 + class_unregister(&ipmi_class); 884 884 pr_warn("ipmi: can't register smi watcher\n"); 885 885 return rv; 886 886 } ··· 895 895 mutex_lock(&reg_list_mutex); 896 896 list_for_each_entry_safe(entry, entry2, &reg_list, link) { 897 897 list_del(&entry->link); 898 - device_destroy(ipmi_class, entry->dev); 898 + device_destroy(&ipmi_class, entry->dev); 899 899 kfree(entry); 900 900 } 901 901 mutex_unlock(&reg_list_mutex); 902 - class_destroy(ipmi_class); 902 + class_unregister(&ipmi_class); 903 903 ipmi_smi_watcher_unregister(&smi_watcher); 904 904 unregister_chrdev(ipmi_major, DEVICE_NAME); 905 905 }
+1 -1
drivers/char/ipmi/ipmi_ipmb.c
··· 572 572 .name = DEVICE_NAME, 573 573 .of_match_table = of_ipmi_ipmb_match, 574 574 }, 575 - .probe_new = ipmi_ipmb_probe, 575 + .probe = ipmi_ipmb_probe, 576 576 .remove = ipmi_ipmb_remove, 577 577 .id_table = ipmi_ipmb_id, 578 578 };
+5
drivers/char/ipmi/ipmi_si_intf.c
··· 2082 2082 new_smi->io.io_cleanup = NULL; 2083 2083 } 2084 2084 2085 + if (rv && new_smi->si_sm) { 2086 + kfree(new_smi->si_sm); 2087 + new_smi->si_sm = NULL; 2088 + } 2089 + 2085 2090 return rv; 2086 2091 } 2087 2092
+2 -2
drivers/char/ipmi/ipmi_si_platform.c
··· 269 269 } 270 270 271 271 memset(&io, 0, sizeof(io)); 272 - io.si_type = (enum si_type) match->data; 272 + io.si_type = (unsigned long) match->data; 273 273 io.addr_source = SI_DEVICETREE; 274 274 io.irq_setup = ipmi_std_irq_setup; 275 275 ··· 381 381 dev_info(dev, "%pR regsize %d spacing %d irq %d\n", 382 382 res, io.regsize, io.regspacing, io.irq); 383 383 384 - request_module("acpi_ipmi"); 384 + request_module_nowait("acpi_ipmi"); 385 385 386 386 return ipmi_si_add_smi(&io); 387 387 }
+8 -3
drivers/char/ipmi/ipmi_ssif.c
··· 1400 1400 restart: 1401 1401 list_for_each_entry(info, &ssif_infos, link) { 1402 1402 if (info->binfo.addr == addr) { 1403 - if (info->addr_src == SI_SMBIOS) 1403 + if (info->addr_src == SI_SMBIOS && !info->adapter_name) 1404 1404 info->adapter_name = kstrdup(adapter_name, 1405 1405 GFP_KERNEL); 1406 1406 ··· 1439 1439 if (acpi_handle) { 1440 1440 ssif_info->addr_source = SI_ACPI; 1441 1441 ssif_info->addr_info.acpi_info.acpi_handle = acpi_handle; 1442 - request_module("acpi_ipmi"); 1442 + request_module_nowait("acpi_ipmi"); 1443 1443 return true; 1444 1444 } 1445 1445 #endif ··· 1600 1600 info->addr_src = SI_ACPI; 1601 1601 info->client = client; 1602 1602 info->adapter_name = kstrdup(client->adapter->name, GFP_KERNEL); 1603 + if (!info->adapter_name) { 1604 + kfree(info); 1605 + return -ENOMEM; 1606 + } 1607 + 1603 1608 info->binfo.addr = client->addr; 1604 1609 list_add_tail(&info->link, &ssif_infos); 1605 1610 return 0; ··· 2059 2054 .driver = { 2060 2055 .name = DEVICE_NAME 2061 2056 }, 2062 - .probe_new = ssif_probe, 2057 + .probe = ssif_probe, 2063 2058 .remove = ssif_remove, 2064 2059 .alert = ssif_alert, 2065 2060 .id_table = ssif_id,
+1 -1
drivers/char/ipmi/ipmi_watchdog.c
··· 802 802 803 803 init_waitqueue_entry(&wait, current); 804 804 add_wait_queue(&read_q, &wait); 805 - while (!data_to_read) { 805 + while (!data_to_read && !signal_pending(current)) { 806 806 set_current_state(TASK_INTERRUPTIBLE); 807 807 spin_unlock_irq(&ipmi_read_lock); 808 808 schedule();
+3 -2
drivers/char/ipmi/kcs_bmc.c
··· 56 56 { 57 57 struct kcs_bmc_client *client; 58 58 irqreturn_t rc = IRQ_NONE; 59 + unsigned long flags; 59 60 60 - spin_lock(&kcs_bmc->lock); 61 + spin_lock_irqsave(&kcs_bmc->lock, flags); 61 62 client = kcs_bmc->client; 62 63 if (client) 63 64 rc = client->ops->event(client); 64 - spin_unlock(&kcs_bmc->lock); 65 + spin_unlock_irqrestore(&kcs_bmc->lock, flags); 65 66 66 67 return rc; 67 68 }
+1 -1
drivers/char/ipmi/ssif_bmc.c
··· 860 860 .name = DEVICE_NAME, 861 861 .of_match_table = ssif_bmc_match, 862 862 }, 863 - .probe_new = ssif_bmc_probe, 863 + .probe = ssif_bmc_probe, 864 864 .remove = ssif_bmc_remove, 865 865 .id_table = ssif_bmc_id, 866 866 };