Skip to content

Commit 91329cb

Browse files
Charles Hanchanwoochoi
authored andcommitted
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: 8a590d7 ("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>
1 parent 40384c8 commit 91329cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/extcon/extcon-rtk-type-c.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,8 @@ static int extcon_rtk_type_c_probe(struct platform_device *pdev)
13691369
}
13701370

13711371
type_c->type_c_cfg = devm_kzalloc(dev, sizeof(*type_c_cfg), GFP_KERNEL);
1372+
if (!type_c->type_c_cfg)
1373+
return -ENOMEM;
13721374

13731375
memcpy(type_c->type_c_cfg, type_c_cfg, sizeof(*type_c_cfg));
13741376

0 commit comments

Comments
 (0)