* soc: mediatek: mtk-svs: fix passing zero to 'PTR_ERR'
@ 2023-02-16 13:25 Roger Lu
2023-03-30 9:30 ` Matthias Brugger
0 siblings, 1 reply; 2+ messages in thread
From: Roger Lu @ 2023-02-16 13:25 UTC (permalink / raw)
To: Matthias Brugger, Enric Balletbo Serra, Kevin Hilman,
Nicolas Boichat
Cc: Fan Chen, Roger Lu, Jia-wei Chang, devicetree, linux-arm-kernel,
linux-mediatek, linux-kernel, linux-pm,
Project_Global_Chrome_Upstream_Group
nvmem_cell_get() cannot return NULL so checking for NULL is wrong here.
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Fixes: 6c7174fd90a4690 ("soc: mediatek: mtk-svs: use svs get efuse common function")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202302160720.N64SWT4l-lkp@intel.com/
---
drivers/soc/mediatek/mtk-svs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index a7eb019b5157..8127fb6d587b 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
struct nvmem_cell *cell;
cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
- if (IS_ERR_OR_NULL(cell)) {
+ if (IS_ERR(cell)) {
dev_err(svsp->dev, "no \"%s\"? %ld\n",
nvmem_cell_name, PTR_ERR(cell));
return PTR_ERR(cell);
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: soc: mediatek: mtk-svs: fix passing zero to 'PTR_ERR'
2023-02-16 13:25 soc: mediatek: mtk-svs: fix passing zero to 'PTR_ERR' Roger Lu
@ 2023-03-30 9:30 ` Matthias Brugger
0 siblings, 0 replies; 2+ messages in thread
From: Matthias Brugger @ 2023-03-30 9:30 UTC (permalink / raw)
To: Roger Lu, Enric Balletbo Serra, Kevin Hilman, Nicolas Boichat
Cc: Fan Chen, Jia-wei Chang, devicetree, linux-arm-kernel,
linux-mediatek, linux-kernel, linux-pm,
Project_Global_Chrome_Upstream_Group
On 16/02/2023 14:25, Roger Lu wrote:
> nvmem_cell_get() cannot return NULL so checking for NULL is wrong here.
>
> Signed-off-by: Roger Lu <roger.lu@mediatek.com>
> Fixes: 6c7174fd90a4690 ("soc: mediatek: mtk-svs: use svs get efuse common function")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202302160720.N64SWT4l-lkp@intel.com/
Applied, thanks.
> ---
> drivers/soc/mediatek/mtk-svs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index a7eb019b5157..8127fb6d587b 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
> struct nvmem_cell *cell;
>
> cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
> - if (IS_ERR_OR_NULL(cell)) {
> + if (IS_ERR(cell)) {
> dev_err(svsp->dev, "no \"%s\"? %ld\n",
> nvmem_cell_name, PTR_ERR(cell));
> return PTR_ERR(cell);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-30 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 13:25 soc: mediatek: mtk-svs: fix passing zero to 'PTR_ERR' Roger Lu
2023-03-30 9:30 ` Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).