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

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

Pull IPMI fixes from Corey Minyard:
"A few bug fixes for patches that went in this release: a refcount
error and some missing or incorrect error checks"

* tag 'for-linus-6.18-2' of https://github.com/cminyard/linux-ipmi:
ipmi: Fix handling of messages with provided receive message pointer
mfd: ls2kbmc: check for devm_mfd_add_devices() failure
mfd: ls2kbmc: Fix an IS_ERR() vs NULL check in probe()

+12 -5
+4 -1
drivers/char/ipmi/ipmi_msghandler.c
··· 2301 2301 if (supplied_recv) { 2302 2302 recv_msg = supplied_recv; 2303 2303 recv_msg->user = user; 2304 - if (user) 2304 + if (user) { 2305 2305 atomic_inc(&user->nr_msgs); 2306 + /* The put happens when the message is freed. */ 2307 + kref_get(&user->refcount); 2308 + } 2306 2309 } else { 2307 2310 recv_msg = ipmi_alloc_recv_msg(user); 2308 2311 if (IS_ERR(recv_msg))
+8 -4
drivers/mfd/ls2k-bmc-core.c
··· 469 469 return ret; 470 470 471 471 ddata = devm_kzalloc(&dev->dev, sizeof(*ddata), GFP_KERNEL); 472 - if (IS_ERR(ddata)) { 472 + if (!ddata) { 473 473 ret = -ENOMEM; 474 474 goto disable_pci; 475 475 } ··· 495 495 goto disable_pci; 496 496 } 497 497 498 - return devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 499 - ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells), 500 - &dev->resource[0], 0, NULL); 498 + ret = devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 499 + ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells), 500 + &dev->resource[0], 0, NULL); 501 + if (ret) 502 + goto disable_pci; 503 + 504 + return 0; 501 505 502 506 disable_pci: 503 507 pci_disable_device(dev);