Commit cbe4a61d authored by Alexander Shishkin's avatar Alexander Shishkin

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: default avatarAlan Cox <alan.cox@intel.com>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: default avatarLaurent Fert <laurent.fert@intel.com>
parent 8fa11d1c
...@@ -688,6 +688,8 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data, ...@@ -688,6 +688,8 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
return 0; return 0;
err_device: err_device:
unregister_chrdev(stm->major, stm_data->name);
/* matches device_initialize() above */ /* matches device_initialize() above */
put_device(&stm->dev); put_device(&stm->dev);
err_free: err_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment