summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorShailendra Verma <shailendra.capricorn@gmail.com>2015-05-19 20:29:00 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 13:27:13 -0700
commit283d93041a424a6152626940f4bc0deb78faacae (patch)
treeac211ba44585ab8863c81e0c652cbcd64b61a7b2 /drivers/staging
parentad5b0d07b1ae1bc82d7dbca943ebae95361a10fb (diff)
downloadlinux-283d93041a424a6152626940f4bc0deb78faacae.tar.bz2
Staging:Android:ion - Fix for memory leak if ion device registration get failed.
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/android/ion/ion.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index b0b96ab31954..6f4811263557 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1579,6 +1579,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);
}