Skip to content

Commit 0892507

Browse files
Dan Carpentercminyard
authored andcommitted
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: d952bba ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support") Signed-off-by: Dan Carpenter <[email protected]> Message-ID: <df80c6d61229eb8f877c3694525c0f97e64a43e8.1759478975.git.dan.carpenter@linaro.org> Signed-off-by: Corey Minyard <[email protected]>
1 parent e406d57 commit 0892507

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mfd/ls2k-bmc-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
469469
return ret;
470470

471471
ddata = devm_kzalloc(&dev->dev, sizeof(*ddata), GFP_KERNEL);
472-
if (IS_ERR(ddata)) {
472+
if (!ddata) {
473473
ret = -ENOMEM;
474474
goto disable_pci;
475475
}

0 commit comments

Comments
 (0)