lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Staging:Android:ion - Fix for memory leak if ion device registration get failed.
Date
Fix to avoid possible memory leak if the ion device registration
get failed.Free the allocated device creation memory before return
in case the ion device registration get failed.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
---
drivers/staging/android/ion/ion.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 584a226..b7255a9 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1577,6 +1577,7 @@ struct ion_device *ion_device_create(long (*custom_ioctl)
ret = misc_register(&idev->dev);
if (ret) {
pr_err("ion: failed to register misc device.\n");
+ kfree(idev);
return ERR_PTR(ret);
}

--
1.7.9.5


\
 
 \ /
  Last update: 2015-05-19 17:21    [W:0.023 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site