aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle2016-05-13 01:11:13 -0500
committerNicolai Hähnle2016-06-10 13:15:15 -0500
commit9bdec97a1991c3cc53d1601eb809e33b154a198d (patch)
treea7f61a07afbba891ab9089ab0e7317e4d9cb1663 /xf86drm.c
parent70b64073f7d1bf56a30f7a809bd984d3ad688b9f (diff)
downloadexternal-libdrm-9bdec97a1991c3cc53d1601eb809e33b154a198d.tar.gz
external-libdrm-9bdec97a1991c3cc53d1601eb809e33b154a198d.tar.xz
external-libdrm-9bdec97a1991c3cc53d1601eb809e33b154a198d.zip
xf86drm: ensure proper alignment of pointers in drmProcessPciDevice
Previously, (*device)->businfo.pci would end up misaligned, which results in undefined behavior. Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 4fdcaf8f..804a4134 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3000,7 +3000,7 @@ static int drmProcessPciDevice(drmDevicePtr *device, const char *d_name,
3000 const char *node, int node_type, 3000 const char *node, int node_type,
3001 int maj, int min, bool fetch_deviceinfo) 3001 int maj, int min, bool fetch_deviceinfo)
3002{ 3002{
3003 const int max_node_str = drmGetMaxNodeName(); 3003 const int max_node_str = ALIGN(drmGetMaxNodeName(), sizeof(void *));
3004 int ret, i; 3004 int ret, i;
3005 char *addr; 3005 char *addr;
3006 3006