[ALPS05154614] Touch: coverity fix for NULL reference case

Check NULL reference the use it.

MTK-Commit-Id: 539f9bceffb19acccf4d58aea1887dca30f2c749

Change-Id: Ie7f5cd9c543eb40bd572ad8f741c9ec4d6e0332e
CR-Id: ALPS05154614
Feature: [Android Default] CapTouch
Signed-off-by: Quanfeng.wang <quanfeng.wang@mediatek.com>
(cherry picked from commit 68340ab0610cd702c45c8bbd80938df1b78c027e)
This commit is contained in:
Quanfeng Wang
2020-08-14 22:47:47 +08:00
committed by Quanfeng Wang (王泉峰)
parent 94b35f5609
commit a67fb951a1

View File

@@ -204,12 +204,13 @@ int goodix_cfg_bin_proc(void *data)
struct goodix_cfg_bin *cfg_bin =
kzalloc(sizeof(struct goodix_cfg_bin), GFP_KERNEL);
cfg_bin->cfg_pkgs = NULL;
if (!cfg_bin) {
ts_err("Failed to alloc memory for cfg_bin");
r = -ENOMEM;
goto out;
}
cfg_bin->cfg_pkgs = NULL;
/*get cfg_bin from file system*/
r = goodix_read_cfg_bin(dev, cfg_bin);
if (r < 0) {