lkml.org 
[lkml]   [2016]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] stm class: Add a missing call to put_device
Date
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);
\
 
 \ /
  Last update: 2016-11-19 19:26    [W:0.057 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site