[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGTfZH2fMx6-Aitn8y3hFmtpdxaYJGUNoVePBrfDgFi-opWeOw@mail.gmail.com>
Date: Sun, 8 Dec 2024 21:45:14 +0900
From: Chanwoo Choi <chanwoo@...nel.org>
To: Charles Han <hanchunchao@...pur.com>
Cc: stanley_chang@...ltek.com, myungjoo.ham@...sung.com, cw00.choi@...sung.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: realtek: fix NULL deref check in extcon_rtk_type_c_probe
Hi,
Applied it. Thanks.
On Fri, Oct 25, 2024 at 6:55 PM Charles Han <hanchunchao@...pur.com> wrote:
>
> 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")
> Signed-off-by: Charles Han <hanchunchao@...pur.com>
> ---
> drivers/extcon/extcon-rtk-type-c.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/extcon/extcon-rtk-type-c.c b/drivers/extcon/extcon-rtk-type-c.c
> index 19a01e663733..2820c7e82481 100644
> --- a/drivers/extcon/extcon-rtk-type-c.c
> +++ b/drivers/extcon/extcon-rtk-type-c.c
> @@ -1369,6 +1369,8 @@ static int extcon_rtk_type_c_probe(struct platform_device *pdev)
> }
>
> type_c->type_c_cfg = devm_kzalloc(dev, sizeof(*type_c_cfg), GFP_KERNEL);
> + if (!type_c->type_c_cfg)
> + return -ENOMEM;
>
> memcpy(type_c->type_c_cfg, type_c_cfg, sizeof(*type_c_cfg));
>
> --
> 2.31.1
>
>
--
Best Regards,
Chanwoo Choi
Samsung Electronics
Powered by blists - more mailing lists