lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1473906043-28683-1-git-send-email-weiyj.lk@gmail.com>
Date:   Thu, 15 Sep 2016 02:20:43 +0000
From:   Wei Yongjun <weiyj.lk@...il.com>
To:     Laura Abbott <labbott@...hat.com>, sumit.semwal@...aro.org,
        gregkh@...uxfoundation.org, arve@...roid.com,
        riandrews@...roid.com, bhaktipriya96@...il.com,
        yudongbin@...ilicon.com, puck.chen@...ilicon.com
Cc:     Wei Yongjun <weiyongjun1@...wei.com>, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()

From: Wei Yongjun <weiyongjun1@...wei.com>

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@...wei.com>
---
 drivers/staging/android/ion/hisilicon/hi6220_ion.c | 4 ++--
 1 file 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 f392db2..659aa71 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))



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ