Commit a535a9f1 authored by Dudley Du's avatar Dudley Du Committed by Dmitry Torokhov

Input: cyapa - fix variable being dereferenced before check

Fixes the warning regarding variable being dereferenced before check
'gen5_pip->resp_len'.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDudley Du <dudl@cypress.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2be7256f
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment