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/[email protected]/ Signed-off-by: Charles Han <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 40384c8 commit 91329cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)