Skip to content

Commit

Permalink
staging: vchiq: call unregister_chrdev_region() when driver registrat…
Browse files Browse the repository at this point in the history
…ion fails

This undoes the previous call to alloc_chrdev_region() on failure,
and is probably what was meant originally given the label name.

Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
Cc: stable <stable@vger.kernel.org>
Fixes: 187ac53 ("staging: vchiq_arm: rework probe and init functions")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20191203153921.70540-1-marcgonzalez@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Marcelo Diop-Gonzalez authored and Greg Kroah-Hartman committed Dec 10, 2019
1 parent 1af73a2 commit d2cdb20
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3309,7 +3309,7 @@ static int __init vchiq_driver_init(void)
return 0;

region_unregister:
platform_driver_unregister(&vchiq_driver);
unregister_chrdev_region(vchiq_devid, 1);

class_destroy:
class_destroy(vchiq_class);
Expand Down

0 comments on commit d2cdb20

Please sign in to comment.