intel_th: Check for NULL instead of ERR_PTR
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 16 Oct 2015 14:09:13 +0000 (17:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 06:25:48 +0000 (23:25 -0700)
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>
drivers/hwtracing/intel_th/gth.c
drivers/hwtracing/intel_th/msu.c
drivers/hwtracing/intel_th/pti.c
drivers/hwtracing/intel_th/sth.c

index 673d272ee4001a9c02962079208c2b54974eee46..2dc5378ccd3aa3bb238416396d9fa1d7cbf910a4 100644 (file)
@@ -635,8 +635,8 @@ static int intel_th_gth_probe(struct intel_th_device *thdev)
                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)
index 80a12384ed2081fe1025332d7ddaaa6ea89e3525..70ca27e4560214f2f58dc93cf2fad57fbe2e8990 100644 (file)
@@ -1458,8 +1458,8 @@ static int intel_th_msc_probe(struct intel_th_device *thdev)
                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)
index 1e3bbc89825c862425cafb1219f82327a894efde..57cbfdcc7ef011381143cf534ceb9ed20a3bd030 100644 (file)
@@ -207,8 +207,8 @@ static int intel_th_pti_probe(struct intel_th_device *thdev)
                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)
index e488fccbfdec0e561f727d464d5479c680887979..56101c33e10f8d8bc668ef8a8d3a89f6fcd24343 100644 (file)
@@ -194,16 +194,16 @@ static int intel_th_sth_probe(struct intel_th_device *thdev)
                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)