1
0
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()
This commit is contained in:
Linus Torvalds
2025-10-14 09:15:45 -07:00
2 changed files with 12 additions and 5 deletions

View File

@@ -2301,8 +2301,11 @@ static int i_ipmi_request(struct ipmi_user *user,
if (supplied_recv) {
recv_msg = supplied_recv;
recv_msg->user = user;
if (user)
if (user) {
atomic_inc(&user->nr_msgs);
/* The put happens when the message is freed. */
kref_get(&user->refcount);
}
} else {
recv_msg = ipmi_alloc_recv_msg(user);
if (IS_ERR(recv_msg))

View File

@@ -469,7 +469,7 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
return ret;
ddata = devm_kzalloc(&dev->dev, sizeof(*ddata), GFP_KERNEL);
if (IS_ERR(ddata)) {
if (!ddata) {
ret = -ENOMEM;
goto disable_pci;
}
@@ -495,9 +495,13 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto disable_pci;
}
return devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells),
&dev->resource[0], 0, NULL);
ret = devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells),
&dev->resource[0], 0, NULL);
if (ret)
goto disable_pci;
return 0;
disable_pci:
pci_disable_device(dev);