summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-15 04:20:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-16 10:22:35 +0200
commit299ac44422fbe7ff23ff1f01667cfe87bc61c74a (patch)
tree1a63bcdab71298f00527a48dd8f5d4a81807eeb7
parentstaging: lustre: Remove unnecessary return capture (diff)
downloadlinux-299ac44422fbe7ff23ff1f01667cfe87bc61c74a.tar.xz
linux-299ac44422fbe7ff23ff1f01667cfe87bc61c74a.zip
staging: android: ion: Fix return value check in hi6220_ion_probe()
In case of error, the function ion_device_create() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Acked-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/android/ion/hisilicon/hi6220_ion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
index f392db2fe6eb..659aa71a1962 100644
--- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
+++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
@@ -49,8 +49,8 @@ static int hi6220_ion_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ipdev);
ipdev->idev = ion_device_create(NULL);
- if (!ipdev->idev)
- return -ENOMEM;
+ if (IS_ERR(ipdev->idev))
+ return PTR_ERR(ipdev->idev);
ipdev->data = ion_parse_dt(pdev, hisi_heaps);
if (IS_ERR(ipdev->data))