The devm_kzalloc() function returns NULL on error so check for that
instead of error pointers.
Fixes: d952bba3fbb5 ("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>
return ret;
ddata = devm_kzalloc(&dev->dev, sizeof(*ddata), GFP_KERNEL);
- if (IS_ERR(ddata)) {
+ if (!ddata) {
ret = -ENOMEM;
goto disable_pci;
}