]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: megaraid: Fix error check return value of register_chrdev()
authorLv Ruyi <lv.ruyi@zte.com.cn>
Mon, 18 Apr 2022 10:57:55 +0000 (10:57 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 13:02:44 +0000 (09:02 -0400)
commit468ca4ed8ab44f923ccc833e107ac5fd3fd58ef3
tree6b357e6a5571de4d2f35a476d95c96a1594a9b17
parentfd1dbdc49d087b9c13aae333e2c42f76caf70997
scsi: megaraid: Fix error check return value of register_chrdev()

If major equals 0, register_chrdev() returns an error code when it fails.
This function dynamically allocates a major and returns its number on
success, so we should use "< 0" to check it instead of "!".

Link: https://lore.kernel.org/r/20220418105755.2558828-1-lv.ruyi@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid.c