linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR
@ 2016-04-07 16:32 Sudip Mukherjee
  2016-04-07 22:05 ` Laura Abbott
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2016-04-07 16:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Riley Andrews
  Cc: linux-kernel, devel, Sudip Mukherjee

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@codethink.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR
  2016-04-07 16:32 [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR Sudip Mukherjee
@ 2016-04-07 22:05 ` Laura Abbott
  0 siblings, 0 replies; 2+ messages in thread
From: Laura Abbott @ 2016-04-07 22:05 UTC (permalink / raw)
  To: Sudip Mukherjee, Greg Kroah-Hartman, Arve Hjønnevåg,
	Riley Andrews
  Cc: devel, linux-kernel

On 04/07/2016 09:32 AM, Sudip Mukherjee wrote:
> ion_device_create() can fail and if it fails then it returns the error
> value in ERR_PTR.
>

Reviewed-by: Laura Abbott <labbott@redhat.com>

> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.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)
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 16:32 [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR Sudip Mukherjee
2016-04-07 22:05 ` Laura Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).