summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-05-13 01:11:13 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-06-10 20:15:15 +0200
commit9bdec97a1991c3cc53d1601eb809e33b154a198d (patch)
treea7f61a07afbba891ab9089ab0e7317e4d9cb1663
parent70b64073f7d1bf56a30f7a809bd984d3ad688b9f (diff)
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>
-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,
const char *node, int node_type,
int maj, int min, bool fetch_deviceinfo)
{
- const int max_node_str = drmGetMaxNodeName();
+ const int max_node_str = ALIGN(drmGetMaxNodeName(), sizeof(void *));
int ret, i;
char *addr;