diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-04-07 16:32:25 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 00:40:50 (GMT) |
commit | 9f563f1a2a4b448393159b3d526a6657dc4c0fce (patch) | |
tree | d68066e6e0e7b84b282e475d6c8b3ada3be12251 /drivers/staging/android/ion | |
parent | 3229ff343c70163b5425e54cce1f313a9be6b85e (diff) | |
download | linux-9f563f1a2a4b448393159b3d526a6657dc4c0fce.tar.xz |
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@codethink.co.uk>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion')
-rw-r--r-- | drivers/staging/android/ion/ion_dummy_driver.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c index 5678870..814a3c9 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) |