staging: android: ion: dummy: fix dereference of ERR_PTR
PATCH 1/1 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 <[email protected]>
--- drivers/staging/android/ion/ion_dummy_driver.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/android/ion/ion_dummy_driver.c +2 -0
@@ -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)
Signature · 1 line
1.9.1
Quoted 3 lines · Sudip Mukherjee
ion_device_create()can fail and if it fails then it returns the error value inERR_PTR.
Reviewed-by Laura Abbott <[email protected]>
Quoted 19 lines
Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/staging/android/ion/ion_dummy_driver.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/android/ion/ion_dummy_driver.c +2
-0@@ -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)