stm class: Do not leak the chrdev in error path
[ Upstream commit cbe4a61d1ddc4790d950ca8c33ef79ee68ef5e2b ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fbfaa26fa9
commit
2040e80d80
1 changed files with 2 additions and 0 deletions
|
@ -686,6 +686,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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue