Re: [PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

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


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux