staging: crystalhd: fix signed bug
Subsystems (2)
PATCH 1/1 staging: crystalhd: fix signed bug
chd_dec_major is unsigned, so check chd_dec_major < 0 doesn't make sense. Since it is used as signed, declare it as int.
Signed-off-by Vasiliy Kulikov <[email protected]>
---
Compile tested.
drivers/staging/crystalhd/crystalhd_lnx.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/crystalhd/crystalhd_lnx.h +1 -1
@@ -76,7 +76,7 @@ struct crystalhd_adp {spinlock_t lock;/* API Related */ -unsigned int chd_dec_major; +int chd_dec_major;unsigned int cfg_users;struct crystalhd_ioctl_data *idata_free_head;/* ioctl data pool */
Signature · 1 line
1.7.0.4
Quoted 4 lines · Vasiliy Kulikov
chd_dec_majoris unsigned, so checkchd_dec_major< 0 doesn't make sense. Since it is used as signed, declare it as int.Signed-off-by Vasiliy Kulikov <[email protected]>
Indeed, Bad Things here when we try to store the ret from register_chrdev in an unsigned int and test it for < 0...
Acked-by Jarod Wilson <[email protected]>
Signature · 2 lines
Jarod Wilson [email protected]