Skip to contentSkip to conversation

drm/msm: Fix uninitialized var usage in dsi_phy_28nm_8960.c

PATCH In review Sean Paul 2 participants 3 messages May 7, 2021

Subsystems (3)
lore
Share & tools
lore

Sean Paul

author reviewer
#0 lore raw

PATCH 1/1 drm/msm: Fix uninitialized var usage in dsi_phy_28nm_8960.c

From: Sean Paul <[email protected]>

This patch fixes the following error:

drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:425:11: error: variable 'parent_name' is uninitialized when used here [-Werror,-Wuninitialized]

        snprintf(parent_name, 32, "dsi%dvco_clk", pll_28nm->phy->id);
                 ^~~~~~~~~~~
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:385:30:
note: initialize the variable 'parent_name' to silence this warning
        char *clk_name, *parent_name, *vco_name;
                                    ^
                                     = NULL

1 error generated.
make[5]: ***
[scripts/Makefile.build:279: drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.o] Error 1

It looks like the allocation was inadvertently deleted.

Fixes 5d13459650b3 ("drm/msm/dsi: push provided clocks handling into a generic code")
Cc Dmitry Baryshkov <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Rob Clark <[email protected]>
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c +4 -0
index 582b1428f971..86e40a0d41a3 100644
@@ -405,6 +405,10 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
 	if (!vco_name)
 		return -ENOMEM;
 
+	parent_name = devm_kzalloc(dev, 32, GFP_KERNEL);
+	if (!parent_name)
+		return -ENOMEM;
+
 	clk_name = devm_kzalloc(dev, 32, GFP_KERNEL);
 	if (!clk_name)
 		return -ENOMEM;
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
#1 lore raw
Quoted 20 lines · Sean Paul

From: Sean Paul <[email protected]>

This patch fixes the following error:

drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:425:11: error: variable 'parent_name' is uninitialized when used here [-Werror,-Wuninitialized]

        snprintf(parent_name, 32, "dsi%dvco_clk", pll_28nm->phy->id);
                 ^~~~~~~~~~~
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:385:30:
note: initialize the variable 'parent_name' to silence this warning
        char *clk_name, *parent_name, *vco_name;
                                    ^
                                     = NULL

1 error generated.
make[5]: ***
[scripts/Makefile.build:279: drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.o] Error 1

It looks like the allocation was inadvertently deleted.

Quoted 7 lines
Fixes 5d13459650b3 ("drm/msm/dsi: push provided clocks handling into a generic code")
Cc Dmitry Baryshkov <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Rob Clark <[email protected]>

Thanks, I'll pick this up for next -fixes pr

BR,
-R

Quoted 22 lines
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c +4 -1
index 582b1428f971..86e40a0d41a3 100644
@@ -405,6 +405,10 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
        if (!vco_name)
                return -ENOMEM;
 
+       parent_name = devm_kzalloc(dev, 32, GFP_KERNEL);
+       if (!parent_name)
+               return -ENOMEM;
+
        clk_name = devm_kzalloc(dev, 32, GFP_KERNEL);
        if (!clk_name)
                return -ENOMEM;
--

Sean Paul, Software Engineer, Google / Chromium OS

#2 lore raw
Quoted 24 lines · Rob Clark
Quoted 22 lines · Sean Paul

From: Sean Paul <[email protected]>

This patch fixes the following error:

drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:425:11: error: variable 'parent_name' is uninitialized when used here [-Werror,-Wuninitialized]

        snprintf(parent_name, 32, "dsi%dvco_clk", pll_28nm->phy->id);
                 ^~~~~~~~~~~
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c:385:30:
note: initialize the variable 'parent_name' to silence this warning
        char *clk_name, *parent_name, *vco_name;
                                    ^
                                     = NULL

1 error generated.
make[5]: ***
[scripts/Makefile.build:279: drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.o] Error 1

It looks like the allocation was inadvertently deleted.

Fixes 5d13459650b3 ("drm/msm/dsi: push provided clocks handling into a generic code")
Quoted 7 lines
Quoted 5 lines
Cc Dmitry Baryshkov <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Rob Clark <[email protected]>

Thanks, I'll pick this up for next -fixes pr

Oh, sorry, I lied, I already had the same fix from Dmitry

BR,
-R

Quoted 23 lines
Quoted 23 lines
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c +4 -1
index 582b1428f971..86e40a0d41a3 100644
@@ -405,6 +405,10 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
        if (!vco_name)
                return -ENOMEM;
 
+       parent_name = devm_kzalloc(dev, 32, GFP_KERNEL);
+       if (!parent_name)
+               return -ENOMEM;
+
        clk_name = devm_kzalloc(dev, 32, GFP_KERNEL);
        if (!clk_name)
                return -ENOMEM;
--

Sean Paul, Software Engineer, Google / Chromium OS