scsi: qla2xxx: Unregister chrdev if module initialization fails
authorBart Van Assche <bvanassche@acm.org>
Thu, 4 Apr 2019 19:44:46 +0000 (12:44 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Apr 2019 02:16:34 +0000 (22:16 -0400)
commitc794d24ec9eb6658909955772e70f34bef5b5b91
tree73fd664cb1879182b1e2897e857974f91e2c745d
parent2c26348c4d090caeb308530ea893b37897e4a58d
scsi: qla2xxx: Unregister chrdev if module initialization fails

If module initialization fails after the character device has been
registered, unregister the character device. Additionally, avoid
duplicating error path code.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Fixes: 6a03b4cd78f3 ("[SCSI] qla2xxx: Add char device to increase driver use count") # v2.6.35.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c