summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/intel_th/pti.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-10-16 17:09:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-16 23:25:48 -0700
commit73061da07d28ac6724bcd9ce4b51cf51a8b6b40e (patch)
treebda6bd37fb26f21fa47d6e49de3483e124952ed4 /drivers/hwtracing/intel_th/pti.c
parent1c090575b013cd1f0070567203498704fa61b2fc (diff)
downloadlinux-73061da07d28ac6724bcd9ce4b51cf51a8b6b40e.tar.gz
linux-73061da07d28ac6724bcd9ce4b51cf51a8b6b40e.tar.xz
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>
Diffstat (limited to 'drivers/hwtracing/intel_th/pti.c')
-rw-r--r--drivers/hwtracing/intel_th/pti.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwtracing/intel_th/pti.c b/drivers/hwtracing/intel_th/pti.c
index 1e3bbc89825c..57cbfdcc7ef0 100644
--- a/drivers/hwtracing/intel_th/pti.c
+++ b/drivers/hwtracing/intel_th/pti.c
@@ -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)