Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383256 > unrolled thread

[QUEUED v20160420 06/19] stm class: Do not leak the chrdev in error path

Started byAlexander Shishkin <alexander.shishkin@linux.intel.com>
First post2016-04-20 12:50 +0200
Last post2016-04-20 12:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [QUEUED v20160420 06/19] stm class: Do not leak the chrdev in error path Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-04-20 12:50 +0200

#1383256 — [QUEUED v20160420 06/19] stm class: Do not leak the chrdev in error path

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2016-04-20 12:50 +0200
Subject[QUEUED v20160420 06/19] stm class: Do not leak the chrdev in error path
Message-ID<rpXRL-6vx-11@gated-at.bofh.it>
Currently, the error path of stm_register_device() forgets to unregister
the chrdev. Fix this.

Reported-by: Alan Cox <alan.cox@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Laurent Fert <laurent.fert@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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web