diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2016-03-04 17:36:10 +0300 |
---|---|---|
committer | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2016-04-08 16:11:52 +0300 |
commit | cbe4a61d1ddc4790d950ca8c33ef79ee68ef5e2b (patch) | |
tree | 87c9756404d8959ec2b19ad6b974f48f14bd1c2a /drivers/hwtracing/stm | |
parent | 8fa11d1c1322f3de40a0e3f3f3e57436a204fcc4 (diff) | |
download | linux-cbe4a61d1ddc4790d950ca8c33ef79ee68ef5e2b.tar.xz |
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@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Laurent Fert <laurent.fert@intel.com>
Diffstat (limited to 'drivers/hwtracing/stm')
-rw-r--r-- | drivers/hwtracing/stm/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 18f176eac06d..e55ed6714223 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: |