mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
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.
Fixes: d952bba3fb ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <df80c6d61229eb8f877c3694525c0f97e64a43e8.1759478975.git.dan.carpenter@linaro.org>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
parent
e406d57be7
commit
0892507f4a
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user