[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFBinCDigiSYT+AkRmCgEB6u_v2uJLg49aNrt8ddxq97FkEMxw@mail.gmail.com>
Date: Mon, 17 Jan 2022 00:01:27 +0100
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: xkernel.wang@...mail.com
Cc: srinivas.kandagatla@...aro.org,
Neil Armstrong <narmstrong@...libre.com>, khilman@...libre.com,
jbrunet@...libre.com, linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvmem: meson-mx-efuse: check the return value of devm_kstrdup()
Hello,
First of all: thank you for this patch!
On Sun, Jan 16, 2022 at 6:37 AM <xkernel.wang@...mail.com> wrote:
[...]
> @@ -211,6 +211,9 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
>
> efuse->config.name = devm_kstrdup(&pdev->dev, drvdata->name,
> GFP_KERNEL);
> + if (!efuse->config.name)
> + return -ENOMEM;
Looking at other drivers and also at drivers/nvmem/core.c I believe
that the whole devm_kstrdup is unnecessary.
Instead I think the code can be simplified as:
efuse->config.name = drvdata->name;
What do you think?
Best regards,
Martin
Powered by blists - more mailing lists