>>> On 23.01.16 at 10:20, <zhaoshengl...@huawei.com> wrote:
> --- a/xen/include/xen/acpi.h
> +++ b/xen/include/xen/acpi.h
> @@ -39,6 +39,10 @@
>  #define ACPI_MADT_GET_POLARITY(inti) ACPI_MADT_GET_(POLARITY, inti)
>  #define ACPI_MADT_GET_TRIGGER(inti)  ACPI_MADT_GET_(TRIGGER, inti)
>  
> +#define BAD_MADT_ENTRY(entry, end) (                                        \
> +                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
> +                ((struct acpi_subtable_header *)entry)->length < 
> sizeof(*entry))

If you move or otherwise anyway touch existing code, please
always take a critical look at it and at least fix obvious problems.
Read, here: Properly parenthesize all uses of the macro's
parameters. While not desirable, failing to do so may be
acceptable when the scope of such definitions is very limited (as
it was before you moving it), but once globally exposed it needs
to be made safe.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to