From b18fccc8dae490a23b27b5f5fca10c53600020b9 Mon Sep 17 00:00:00 2001 From: Yingyuan Zhu Date: Wed, 29 Aug 2018 19:52:14 +0800 Subject: [PATCH] touchscreen: goodix_gt9xx: fix coverity warning PD#172713: touchscreen: goodix_gt9xx: fix coverity warning There is no judgment about whether the pointer is NULL before using it. This causes "Dereference before null check". Change-Id: Ic4d96cc1e48d16f409b71c70a049b433eeb39bf1 Signed-off-by: Yingyuan Zhu --- drivers/amlogic/input/touchscreen/goodix_gt9xx/gt9xx_update.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/amlogic/input/touchscreen/goodix_gt9xx/gt9xx_update.c b/drivers/amlogic/input/touchscreen/goodix_gt9xx/gt9xx_update.c index 06f1b0e..fdcdcc7 100644 --- a/drivers/amlogic/input/touchscreen/goodix_gt9xx/gt9xx_update.c +++ b/drivers/amlogic/input/touchscreen/goodix_gt9xx/gt9xx_update.c @@ -1013,6 +1013,8 @@ static u8 gup_burn_proc(struct i2c_client *client, u8 *burn_buf, u16 start_addr, u8 retry = 0; GTP_DEBUG("Begin burn %dk data to addr 0x%x", (total_length/1024), start_addr); + if (!burn_buf) + return FAIL; while(burn_length < total_length) { GTP_DEBUG("B/T:%04d/%04d", burn_length, total_length); -- 2.7.4