Skip to content
Commit d48fea84 authored by Lv Ruyi's avatar Lv Ruyi Committed by David S. Miller
Browse files

net: cosa: fix error check return value of register_chrdev()



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

Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Acked-By: default avatarJan "Yenya" Kasprzak <kas@fi.muni.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59f0c244
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