[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460127401-30801-7-git-send-email-alexander.shishkin@linux.intel.com>
Date: Fri, 8 Apr 2016 17:56:29 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Greg KH <greg@...ah.com>
Cc: Mathieu Poirier <mathieu.poirier@...aro.org>,
Chunyan Zhang <zhang.chunyan@...aro.org>,
laurent.fert@...el.com, yann.fouassier@...el.com,
linux-kernel@...r.kernel.org,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: [QUEUED v20160408 06/18] stm class: Do not leak the chrdev in error path
Currently, the error path of stm_register_device() forgets to unregister
the chrdev. Fix this.
Reported-by: Alan Cox <alan.cox@...el.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
---
drivers/hwtracing/stm/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 18f176eac0..e55ed67142 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -688,6 +688,8 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
return 0;
err_device:
+ unregister_chrdev(stm->major, stm_data->name);
+
/* matches device_initialize() above */
put_device(&stm->dev);
err_free:
--
2.8.0.rc3
Powered by blists - more mailing lists