[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 435cc3: hw/acpi/nvdimm: Don't take address of
[Qemu-commits] [qemu/qemu] 435cc3: hw/acpi/nvdimm: Don't take address of fields in pa...
Mon, 12 Nov 2018 07:14:24 -0800
Author: Peter Maydell <address@hidden>
Date: 2018-11-12 (Mon, 12 Nov 2018)
hw/acpi/nvdimm: Don't take address of fields in packed structs
Taking the address of a field in a packed struct is a bad idea, because
it might not be actually aligned enough for that pointer type (and
thus cause a crash on dereference on some host architectures). Newer
versions of clang warn about this. Avoid the bug by not using the
"modify in place" byte swapping functions.
Patch produced with scripts/coccinelle/inplace-byteswaps.cocci.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
**NOTE:** This service has been marked for deprecation:
Functionality will be removed from GitHub.com on January 31st, 2019.
|[Prev in Thread]
||[Next in Thread]|
- [Qemu-commits] [qemu/qemu] 435cc3: hw/acpi/nvdimm: Don't take address of fields in pa...,