From: Sudip Mukherjee Date: Thu, 7 Apr 2016 16:32:25 +0000 (+0530) Subject: staging: android: ion: dummy: fix dereference of ERR_PTR X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f563f1a2a4b448393159b3d526a6657dc4c0fce;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Laura Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c index 5678870bff48..814a3c92a56e 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)