devm_ioremap() returns NULL on error, it doesn't return an ERR_PTR,
which is what the current code does. This patch corrects these
checks.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return -ENODEV;
base = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (!base)
+ return -ENOMEM;
gth = devm_kzalloc(dev, sizeof(*gth), GFP_KERNEL);
if (!gth)
return -ENODEV;
base = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (!base)
+ return -ENOMEM;
msc = devm_kzalloc(dev, sizeof(*msc), GFP_KERNEL);
if (!msc)
return -ENODEV;
base = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (!base)
+ return -ENOMEM;
pti = devm_kzalloc(dev, sizeof(*pti), GFP_KERNEL);
if (!pti)
return -ENODEV;
base = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (!base)
+ return -ENOMEM;
res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 1);
if (!res)
return -ENODEV;
channels = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(channels))
- return PTR_ERR(channels);
+ if (!channels)
+ return -ENOMEM;
sth = devm_kzalloc(dev, sizeof(*sth), GFP_KERNEL);
if (!sth)