X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2Fkstrtox.c;h=94be244e844103d0fb6ed20c7bee905ca908fa12;hb=9e76ff0ffae6a547c0ad5100c142f43f2a5ef669;hp=ec8da78df9be9f4ea245ff398193bd1d90210573;hpb=6ce6d9c214c9752c7bcebba91ef2302176842870;p=firefly-linux-kernel-4.4.55.git diff --git a/lib/kstrtox.c b/lib/kstrtox.c index ec8da78df9be..94be244e8441 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -152,7 +152,7 @@ int kstrtoll(const char *s, unsigned int base, long long *res) rv = _kstrtoull(s + 1, base, &tmp); if (rv < 0) return rv; - if ((long long)(-tmp) >= 0) + if ((long long)-tmp > 0) return -ERANGE; *res = -tmp; } else {