Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

extcon: realtek: fix NULL deref check in extcon_rtk_type_c_probe

In extcon_rtk_type_c_probe() devm_kzalloc() may return NULL but this
returned value is not checked.

Fixes: 8a590d7371f0 ("extcon: add Realtek DHC RTD SoC Type-C driver")
Link: https://lore.kernel.org/lkml/20241025094650.253599-1-hanchunchao@inspur.com/
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Charles Han and committed by
Chanwoo Choi
91329cb0 40384c84

+2
+2
drivers/extcon/extcon-rtk-type-c.c
··· 1369 1369 } 1370 1370 1371 1371 type_c->type_c_cfg = devm_kzalloc(dev, sizeof(*type_c_cfg), GFP_KERNEL); 1372 + if (!type_c->type_c_cfg) 1373 + return -ENOMEM; 1372 1374 1373 1375 memcpy(type_c->type_c_cfg, type_c_cfg, sizeof(*type_c_cfg)); 1374 1376