[PATCH 3/8] Clean up allocation in RADEONInitVideo()

Michel Dänzer michel at daenzer.net
Tue Nov 10 23:16:01 PST 2015


From: Tom St Denis <tom.stdenis at amd.com>

The allocation of the adapters should use the correct sizeof (even if
allocating an array of pointers).

Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
(ported from amdgpu commit db3bb2061b9ac16b0922d9afae99874820356a04)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/radeon_video.c b/src/radeon_video.c
index 7abc2f6..48b06e2 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -145,7 +145,7 @@ void RADEONInitVideo(ScreenPtr pScreen)
 	    return;
 
     num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
-    newAdaptors = malloc((num_adaptors + 2) * sizeof(XF86VideoAdaptorPtr *));
+    newAdaptors = malloc((num_adaptors + 2) * sizeof(*newAdaptors));
     if (newAdaptors == NULL)
 	return;
 
-- 
2.6.2



More information about the xorg-driver-ati mailing list