All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice
@ 2016-05-13  6:14 Nicolai Hähnle
  2016-05-14 23:03 ` Emil Velikov
  2016-06-10 14:07 ` Nicolai Hähnle
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolai Hähnle @ 2016-05-13  6:14 UTC (permalink / raw)
  To: dri-devel; +Cc: Nicolai Hähnle

From: Nicolai Hähnle <nicolai.haehnle@amd.com>

Previously, (*device)->businfo.pci would end up misaligned, which results
in undefined behavior.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
---
 xf86drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xf86drm.c b/xf86drm.c
index 5f587d9..94efc08 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;
 
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-06-10 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13  6:14 [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice Nicolai Hähnle
2016-05-14 23:03 ` Emil Velikov
2016-05-17 15:24   ` Nicolai Hähnle
2016-06-10 14:07 ` Nicolai Hähnle
2016-06-10 16:55   ` Emil Velikov
2016-06-10 18:19     ` Nicolai Hähnle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.