Skip to content
Commit c5acd61d authored by Lv Ruyi's avatar Lv Ruyi Committed by Martin K. Petersen
Browse files

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: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1497e95e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment