[PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@xxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux