mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
intel_th: Check for NULL instead of ERR_PTR
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>
This commit is contained in:
parent
1c090575b0
commit
73061da07d
4 changed files with 10 additions and 10 deletions
|
@ -635,8 +635,8 @@ static int intel_th_gth_probe(struct intel_th_device *thdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
base = devm_ioremap(dev, res->start, resource_size(res));
|
base = devm_ioremap(dev, res->start, resource_size(res));
|
||||||
if (IS_ERR(base))
|
if (!base)
|
||||||
return PTR_ERR(base);
|
return -ENOMEM;
|
||||||
|
|
||||||
gth = devm_kzalloc(dev, sizeof(*gth), GFP_KERNEL);
|
gth = devm_kzalloc(dev, sizeof(*gth), GFP_KERNEL);
|
||||||
if (!gth)
|
if (!gth)
|
||||||
|
|
|
@ -1458,8 +1458,8 @@ static int intel_th_msc_probe(struct intel_th_device *thdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
base = devm_ioremap(dev, res->start, resource_size(res));
|
base = devm_ioremap(dev, res->start, resource_size(res));
|
||||||
if (IS_ERR(base))
|
if (!base)
|
||||||
return PTR_ERR(base);
|
return -ENOMEM;
|
||||||
|
|
||||||
msc = devm_kzalloc(dev, sizeof(*msc), GFP_KERNEL);
|
msc = devm_kzalloc(dev, sizeof(*msc), GFP_KERNEL);
|
||||||
if (!msc)
|
if (!msc)
|
||||||
|
|
|
@ -207,8 +207,8 @@ static int intel_th_pti_probe(struct intel_th_device *thdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
base = devm_ioremap(dev, res->start, resource_size(res));
|
base = devm_ioremap(dev, res->start, resource_size(res));
|
||||||
if (IS_ERR(base))
|
if (!base)
|
||||||
return PTR_ERR(base);
|
return -ENOMEM;
|
||||||
|
|
||||||
pti = devm_kzalloc(dev, sizeof(*pti), GFP_KERNEL);
|
pti = devm_kzalloc(dev, sizeof(*pti), GFP_KERNEL);
|
||||||
if (!pti)
|
if (!pti)
|
||||||
|
|
|
@ -194,16 +194,16 @@ static int intel_th_sth_probe(struct intel_th_device *thdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
base = devm_ioremap(dev, res->start, resource_size(res));
|
base = devm_ioremap(dev, res->start, resource_size(res));
|
||||||
if (IS_ERR(base))
|
if (!base)
|
||||||
return PTR_ERR(base);
|
return -ENOMEM;
|
||||||
|
|
||||||
res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 1);
|
res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 1);
|
||||||
if (!res)
|
if (!res)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
channels = devm_ioremap(dev, res->start, resource_size(res));
|
channels = devm_ioremap(dev, res->start, resource_size(res));
|
||||||
if (IS_ERR(channels))
|
if (!channels)
|
||||||
return PTR_ERR(channels);
|
return -ENOMEM;
|
||||||
|
|
||||||
sth = devm_kzalloc(dev, sizeof(*sth), GFP_KERNEL);
|
sth = devm_kzalloc(dev, sizeof(*sth), GFP_KERNEL);
|
||||||
if (!sth)
|
if (!sth)
|
||||||
|
|
Loading…
Add table
Reference in a new issue