Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbe4a61d authored by Alexander Shishkin's avatar Alexander Shishkin
Browse files

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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: