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>
        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))