mfd: ls2kbmc: Fix a couple Smatch warnings
cover mfd: ls2kbmc: Fix a couple Smatch warnings
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The devm_mfd_add_devices() function isn't going to fail either...
But still, they're worth fixing just for correctness sake.
Dan Carpenter (2):
mfd: ls2kbmc: Fix an IS_ERR() vs NULL check in probe()
mfd: ls2kbmc: check for devm_mfd_add_devices() failure
drivers/mfd/ls2k-bmc-core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0
PATCH 1/2 mfd: ls2kbmc: Fix an IS_ERR() vs NULL check in probe()
The devm_kzalloc() function returns NULL on error so check for that instead of error pointers.
--- drivers/mfd/ls2k-bmc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/ls2k-bmc-core.c +1 -1
@@ -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; }
Signature · 1 line
2.51.0
PATCH 2/2 mfd: ls2kbmc: check for devm_mfd_add_devices() failure
In reply to Dan CarpenterCall pci_disable_device() if devm_mfd_add_devices() fails.
--- drivers/mfd/ls2k-bmc-core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/mfd/ls2k-bmc-core.c +7 -3
@@ -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);
Signature · 1 line
2.51.0
Quoted 9 lines · Dan Carpenter
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The
devm_mfd_add_devices()function isn't going to fail either...But still, they're worth fixing just for correctness sake.
Dan Carpenter (2):
mfd: ls2kbmc: Fix anIS_ERR()vs NULL check inprobe()
mfd: ls2kbmc: check fordevm_mfd_add_devices()failure
Got them, thank you. I'll get this in for 6.18.
-corey
Quoted 7 lines
drivers/mfd/ls2k-bmc-core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)Signature · 1 line
2.51.0
Lee Jones
maintainerQuoted 5 lines · Corey Minyard
Quoted 4 lines · Dan Carpenter
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The
devm_mfd_add_devices()function isn't going to fail either...
Quoted 7 lines
Quoted 5 lines
But still, they're worth fixing just for correctness sake.
Dan Carpenter (2):
mfd: ls2kbmc: Fix anIS_ERR()vs NULL check inprobe()
mfd: ls2kbmc: check fordevm_mfd_add_devices()failureGot them, thank you. I'll get this in for 6.18.
Do what, now?
Signature · 1 line
Lee Jones [李琼斯]
Lee Jones
maintainerQuoted 9 lines · Lee Jones
Quoted 7 lines · Corey Minyard
Quoted 6 lines · Dan Carpenter
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The
devm_mfd_add_devices()function isn't going to fail either...But still, they're worth fixing just for correctness sake.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Dan Carpenter (2):
mfd: ls2kbmc: Fix anIS_ERR()vs NULL check inprobe()
mfd: ls2kbmc: check fordevm_mfd_add_devices()failureGot them, thank you. I'll get this in for 6.18.
Do what, now?
Corey, can you remove these from your IPMI tree please.
They are in the incorrect format and are not yours to collect.
Signature · 1 line
Lee Jones [李琼斯]
Quoted 6 lines · Dan Carpenter
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The
devm_mfd_add_devices()function isn't going to fail either...But still, they're worth fixing just for correctness sake.
Quoted 11 lines
Dan Carpenter (2):
mfd: ls2kbmc: Fix anIS_ERR()vs NULL check inprobe()
mfd: ls2kbmc: check fordevm_mfd_add_devices()failuredrivers/mfd/ls2k-bmc-core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)--
2.51.0
Quoted 11 lines · Dan Carpenter
These are two issues which were detected by Smatch. They're not really going to happen in real life. Small kmalloc()s can't fail. The
devm_mfd_add_devices()function isn't going to fail either...But still, they're worth fixing just for correctness sake.
Dan Carpenter (2):
mfd: ls2kbmc: Fix anIS_ERR()vs NULL check inprobe()
mfd: ls2kbmc: check fordevm_mfd_add_devices()failure[...]
Applied, thanks!
[1/2] mfd: ls2kbmc: Fix an IS_ERR() vs NULL check in probe()
commit: b9be0a544c0684672168c7d4a95dc54ba8e1e883
[2/2] mfd: ls2kbmc: check for devm_mfd_add_devices() failure
commit: 35fc7b7df6761233e9d1f85cfc7fc5c4372a5d7b--
Lee Jones [李琼斯]