* [PATCH] Staging:Android:ion - Fix for memory leak if ion device registration get failed.
@ 2015-05-19 14:59 Shailendra Verma
0 siblings, 0 replies; only message in thread
From: Shailendra Verma @ 2015-05-19 14:59 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Riley Andrews,
Sumit Semwal, Mitchel Humpherys, Phong Tran,
Mauro Carvalho Chehab, Rasmus Villemoes, Markus Elfring, devel
Cc: linux-kernel, Shailendra Verma
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-19 14:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 14:59 [PATCH] Staging:Android:ion - Fix for memory leak if ion device registration get failed Shailendra Verma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®