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]
Date:   Thu,  4 May 2017 22:45:33 +0800
From:   Yisheng Xie <ysxie@...mail.com>
To:     labbott@...hat.com, sumit.semwal@...aro.org,
        gregkh@...uxfoundation.org, arve@...roid.com,
        riandrews@...roid.com, wporter82@...il.com
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ion: hisilicon: check the right value after ion_heap_create

From: Yisheng Xie <xieyisheng1@...wei.com>

It should check ipdev->heaps[i] whether it is error or null instead of
ipdev->heaps, after ion_heap_create() for ipdev->heaps[i].

Signed-off-by: Yisheng Xie <xieyisheng1@...wei.com>
---
 drivers/staging/android/ion/hisilicon/hi6220_ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
index 0de7897..7f8eda5 100644
--- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
+++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
@@ -66,7 +66,7 @@ static int hi6220_ion_probe(struct platform_device *pdev)
 
 	for (i = 0; i < ipdev->data->nr; i++) {
 		ipdev->heaps[i] = ion_heap_create(&ipdev->data->heaps[i]);
-		if (!ipdev->heaps) {
+		if (IS_ERR_OR_NULL(ipdev->heaps[i])) {
 			ion_destroy_platform_data(ipdev->data);
 			return -ENOMEM;
 		}
-- 
1.9.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ