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

Nicolai Hähnle nhaehnle at gmail.com
Fri Jun 10 14:07:50 UTC 2016


Ping.

On 13.05.2016 08:14, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Previously, (*device)->businfo.pci would end up misaligned, which results
> in undefined behavior.
>
> Signed-off-by: Nicolai Hähnle <nicolai.haehnle at 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;
>
>


More information about the dri-devel mailing list