diff options
author | Dudley Du <dudl@cypress.com> | 2015-01-22 17:17:16 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-01-22 17:23:14 +0100 |
commit | a535a9f16cc39b978857d584d6e5fb9840db7db7 (patch) | |
tree | df71de2d15b5285a7121474fadbc956e103dfbcf | |
parent | Input: cyapa - fix endianness issues in gen5 firmware update support (diff) | |
download | linux-a535a9f16cc39b978857d584d6e5fb9840db7db7.tar.xz linux-a535a9f16cc39b978857d584d6e5fb9840db7db7.zip |
Input: cyapa - fix variable being dereferenced before check
Fixes the warning regarding variable being dereferenced before check
'gen5_pip->resp_len'.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/mouse/cyapa_gen5.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/mouse/cyapa_gen5.c b/drivers/input/mouse/cyapa_gen5.c index 9a4a422afc2a..ddf5393a1180 100644 --- a/drivers/input/mouse/cyapa_gen5.c +++ b/drivers/input/mouse/cyapa_gen5.c @@ -2557,7 +2557,9 @@ static bool cyapa_gen5_irq_cmd_handler(struct cyapa *cyapa) * trackpad device when booting/rebooting * their chrome book. */ - length = *gen5_pip->resp_len; + length = 0; + if (gen5_pip->resp_len) + length = *gen5_pip->resp_len; cyapa_empty_pip_output_data(cyapa, gen5_pip->resp_data, &length, |