[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/acpi/nvdimm: Don't take address of fields in
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] hw/acpi/nvdimm: Don't take address of fields in packed structs |
Date: |
Wed, 17 Oct 2018 10:30:16 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Tue, Oct 16, 2018 at 06:52:36PM +0100, Peter Maydell wrote:
> 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>
> ---
> Automatically generated patch, tested with "make check" only.
>
> hw/acpi/nvdimm.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature