diff options
author | Damien Cassou <damien.cassou@lifl.fr> | 2012-08-03 17:40:13 +0200 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-08-23 13:16:11 +0000 |
commit | a654ddac0892eb8495d75cbd7f45646895cc5e5f (patch) | |
tree | 5bed35c64ad3820377200cb86f50335aa2223b37 /drivers/video/msm | |
parent | b7e69add39481dafb509a07ab527784d415b567b (diff) |
drivers/video/msm/mddi_client_nt35399.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch replaces the use of kzalloc by devm_kzalloc.
Additionally, this patch fixes a memory leak: some memory was allocated for
'panel' but not released when the subsequent call to setup_vsync fails.
Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/msm')
-rw-r--r-- | drivers/video/msm/mddi_client_nt35399.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c index 7fcd67e132b..66b314e68de 100644 --- a/drivers/video/msm/mddi_client_nt35399.c +++ b/drivers/video/msm/mddi_client_nt35399.c @@ -189,8 +189,9 @@ static int mddi_nt35399_probe(struct platform_device *pdev) int ret; - struct panel_info *panel = kzalloc(sizeof(struct panel_info), - GFP_KERNEL); + struct panel_info *panel = devm_kzalloc(&pdev->dev, + sizeof(struct panel_info), + GFP_KERNEL); printk(KERN_DEBUG "%s: enter.\n", __func__); @@ -233,7 +234,6 @@ static int mddi_nt35399_remove(struct platform_device *pdev) struct panel_info *panel = platform_get_drvdata(pdev); setup_vsync(panel, 0); - kfree(panel); return 0; } |