public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm: Fix incorrect struct size for memory allocation
@ 2019-02-21 21:54 Jordan Crouse
  2019-02-21 22:08 ` Jeffrey Hugo
  0 siblings, 1 reply; 2+ messages in thread
From: Jordan Crouse @ 2019-02-21 21:54 UTC (permalink / raw)
  To: freedreno
  Cc: linux-arm-msm, stable, Sean Paul, linux-kernel, dri-devel,
	Rob Clark, David Airlie, Daniel Vetter

The allocation for the clock bulk data does a classic sizeof(pointer)
instead of sizeof(struct) so the array ends up incorrectly sized
for the clock data.

Cc: stable@vger.kernel.org
Fixes: 8e54eea ("drm/msm: Add a helper function to parse clock names")
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---

 drivers/gpu/drm/msm/msm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 906b2bb..31e1481 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -96,7 +96,7 @@ int msm_clk_bulk_get(struct device *dev, struct clk_bulk_data **bulk)
 	if (count < 1)
 		return 0;
 
-	local = devm_kcalloc(dev, sizeof(struct clk_bulk_data *),
+	local = devm_kcalloc(dev, sizeof(struct clk_bulk_data),
 		count, GFP_KERNEL);
 	if (!local)
 		return -ENOMEM;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-21 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-21 21:54 [PATCH] drm/msm: Fix incorrect struct size for memory allocation Jordan Crouse
2019-02-21 22:08 ` Jeffrey Hugo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox