From: Dudley Du Date: Thu, 22 Jan 2015 16:17:16 +0000 (-0800) Subject: Input: cyapa - fix variable being dereferenced before check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a535a9f16cc39b978857d584d6e5fb9840db7db7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Dudley Du Signed-off-by: Dmitry Torokhov --- 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,