OSDN Git Service

misc: st_core: Protect unsigned value against becoming negative
authorLee Jones <lee.jones@linaro.org>
Thu, 28 Aug 2014 13:14:08 +0000 (14:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 06:14:28 +0000 (23:14 -0700)
commite4ebe5fe2d507a4c228bf90dea7dd4de57cbce92
tree60a8202982629355778e58a8fa97b684a131b6c1
parent0ae39cc98192252f756f8943be85e9f4dbd8436e
misc: st_core: Protect unsigned value against becoming negative

Coverity reported:
  This less-than-zero comparison of an unsigned value is never true.

In answer to that, we only ever decrement if protos_registered is
positive.  We can subsequently remove the paranoid checking during
unregister.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ti-st/st_core.c