linux-stable/drivers/slimbus
Colin Ian King 551b9ee472 slimbus: fix retries comparison to correctly identify failed allocation
Currently the check for too many retries fails because retries is actually
-1 when the retry loop terminates if no pbuf can be allocated because of
the post decrement on retries.  Fix this by not comparing retries with zero
but instead check if it is negative.

Detected by CoverityScan, CID#1463143 ("Logically dead code") and
CID#1463144 ("Dereference after null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09 17:00:13 +01:00
..
core.c slimbus: Add support for 'clock-pause' feature 2017-12-19 11:01:03 +01:00
Kconfig slimbus: qcom: Add Qualcomm Slimbus controller driver 2017-12-19 11:01:03 +01:00
Makefile slimbus: qcom: Add Qualcomm Slimbus controller driver 2017-12-19 11:01:03 +01:00
messaging.c slimbus: avoid null pointer dereference on msg 2018-01-09 17:00:13 +01:00
qcom-ctrl.c slimbus: fix retries comparison to correctly identify failed allocation 2018-01-09 17:00:13 +01:00
sched.c slimbus: Add support for 'clock-pause' feature 2017-12-19 11:01:03 +01:00
slimbus.h slimbus: core: add common defines required for controllers 2017-12-19 11:01:03 +01:00