commit | d48fea8401cfa942c67cc3a522bf379143dbb576 | [log] [tgz] |
---|---|---|
author | Lv Ruyi <lv.ruyi@zte.com.cn> | Mon Apr 18 10:58:34 2022 +0000 |
committer | David S. Miller <davem@davemloft.net> | Fri Apr 22 10:20:43 2022 +0100 |
tree | f972e34640489a69e5f7e845447a2a87067ae576 | |
parent | 59f0c2447e2553b0918b4a9fd38763a5c0587d02 [diff] |
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: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Acked-By: Jan "Yenya" Kasprzak <kas@fi.muni.cz> Signed-off-by: David S. Miller <davem@davemloft.net>