mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] stm class: Add a missing call to put_device
@ 2016-11-19 18:22 Quentin Lambert
  2016-11-21  7:32 ` Alexander Shishkin
  0 siblings, 1 reply; 3+ messages in thread
From: Quentin Lambert @ 2016-11-19 18:22 UTC (permalink / raw)
  To: Alexander Shishkin, linux-kernel, kernel-janitors; +Cc: Quentin Lambert

Most error branches following the call to class_find_device contain
a call to put_device. This patch add calls to put_device where
they are missing.

This issue was found with Hector.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

---
 drivers/hwtracing/stm/core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -368,8 +368,10 @@ static int stm_char_open(struct inode *i
 		return -ENODEV;
 
 	stmf = kzalloc(sizeof(*stmf), GFP_KERNEL);
-	if (!stmf)
+	if (!stmf) {
+		put_device(dev);
 		return -ENOMEM;
+	}
 
 	stm_output_init(&stmf->output);
 	stmf->stm = to_stm_device(dev);

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

end of thread, other threads:[~2016-11-21  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-19 18:22 [PATCH] stm class: Add a missing call to put_device Quentin Lambert
2016-11-21  7:32 ` Alexander Shishkin
2016-11-21  7:58   ` Quentin Lambert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome