misc: st_core: Protect unsigned value against becoming negative
authorLee Jones <lee.jones@linaro.org>
Wed, 13 Aug 2014 11:23:10 +0000 (12:23 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 26 Sep 2014 07:15:28 +0000 (08:15 +0100)
commit4001998a43f4791b6e6c06df563f5d5bb3fbe4fb
tree8442ebcc721a9844d50da6730fa3771a91c3b47c
parent374de1642ee4322cc4d6aa1d2679378b8547c368
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.

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