Skip to content

Commit

Permalink
Input: cyapa - fix variable being dereferenced before check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dudley Du authored and Dmitry Torokhov committed Jan 22, 2015
1 parent 2be7256 commit a535a9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/mouse/cyapa_gen5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a535a9f

Please sign in to comment.