[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460046745-30345-1-git-send-email-sudipm.mukherjee@gmail.com>
Date: Thu, 7 Apr 2016 22:02:25 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Riley Andrews <riandrews@...roid.com>
Cc: linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR
ion_device_create() can fail and if it fails then it returns the error
value in ERR_PTR.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
---
drivers/staging/android/ion/ion_dummy_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index 5678870..806e76b 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -68,6 +68,8 @@ static int __init ion_dummy_init(void)
int i, err;
idev = ion_device_create(NULL);
+ if (IS_ERR(idev))
+ return PTR_ERR(idev);
heaps = kcalloc(dummy_ion_pdata.nr, sizeof(struct ion_heap *),
GFP_KERNEL);
if (!heaps)
--
1.9.1
Powered by blists - more mailing lists