]> Git Repo - qemu.git/commit - hw/display/qxl.c
qxl: avoid unaligned pointer reads/writes
authorDaniel P. BerrangĂ© <[email protected]>
Fri, 12 Apr 2019 12:16:26 +0000 (13:16 +0100)
committerGerd Hoffmann <[email protected]>
Tue, 7 May 2019 07:55:07 +0000 (09:55 +0200)
commit94932c95c10400acd286fd768a6b411e7ebbec8f
tree6a366ba90b3556b8945ccc90ab4d2a4011c1cc0c
parentdceb885255b8f7c79ab440ea242c9180bfaf4a84
qxl: avoid unaligned pointer reads/writes

The SPICE_RING_PROD_ITEM() macro is initializing a local
'uint64_t *' variable to point to the 'el' field inside
the QXLReleaseRing struct. This uint64_t field is not
guaranteed aligned as the struct is packed.

Code should not take the address of fields within a
packed struct. Changing the SPICE_RING_PROD_ITEM()
macro to avoid taking the address of the field is
impractical. It is clearer to just remove the macro
and inline its functionality in the three call sites
that need it.

Signed-off-by: Daniel P. BerrangĂ© <[email protected]>
Message-Id: <20190412121626[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/display/qxl.c
This page took 0.025874 seconds and 4 git commands to generate.