linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: davinci_keyscan: Free memory occupied by davinci key scan device
@ 2017-11-14 13:45 Arvind Yadav
  2017-11-14 18:14 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-11-14 13:45 UTC (permalink / raw)
  To: dmitry.torokhov, linux; +Cc: linux-kernel, linux-input

Here, key_dev is NULL in input_free_device() and It will not free
memory occupied by davinci key scan device. Move "key_dev = NULL"
after input_free_device().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/keyboard/davinci_keyscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
index b20a5d0..22cb8d2 100644
--- a/drivers/input/keyboard/davinci_keyscan.c
+++ b/drivers/input/keyboard/davinci_keyscan.c
@@ -290,13 +290,13 @@ static int __init davinci_ks_probe(struct platform_device *pdev)
 	free_irq(davinci_ks->irq, davinci_ks);
 fail5:
 	input_unregister_device(davinci_ks->input);
-	key_dev = NULL;
 fail4:
 	iounmap(davinci_ks->base);
 fail3:
 	release_mem_region(davinci_ks->pbase, davinci_ks->base_size);
 fail2:
 	input_free_device(key_dev);
+	key_dev = NULL;
 fail1:
 	kfree(davinci_ks);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-14 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 13:45 [PATCH] Input: davinci_keyscan: Free memory occupied by davinci key scan device Arvind Yadav
2017-11-14 18:14 ` Dmitry Torokhov
2017-11-14 18:40   ` arvindY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).