[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] VT-d: Correct order of parameters to memset() in setup_posted_irte()




> -----Original Message-----
> From: Andrew Cooper [mailto:andrew.cooper3@xxxxxxxxxx]
> Sent: Friday, December 11, 2015 12:07 AM
> To: Xen-devel <xen-devel@xxxxxxxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Jan Beulich
> <JBeulich@xxxxxxxx>; Wu, Feng <feng.wu@xxxxxxxxx>; Tian, Kevin
> <kevin.tian@xxxxxxxxx>
> Subject: [PATCH] VT-d: Correct order of parameters to memset() in
> setup_posted_irte()
> 
> Introduced in c/s 83ea9229 "vt-d: add API to update IRTE when VT-d PI is
> used".  Spotted by Coverity.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Feng Wu <feng.wu@xxxxxxxxx>
> CC: Kevin Tian <kevin.tian@xxxxxxxxx>
> ---
>  xen/drivers/passthrough/vtd/intremap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/vtd/intremap.c
> b/xen/drivers/passthrough/vtd/intremap.c
> index 0a48cd4..0ee3fb2 100644
> --- a/xen/drivers/passthrough/vtd/intremap.c
> +++ b/xen/drivers/passthrough/vtd/intremap.c
> @@ -910,7 +910,7 @@ static void setup_posted_irte(
>      struct iremap_entry *new_ire, const struct iremap_entry *old_ire,
>      const struct pi_desc *pi_desc, const uint8_t gvec)
>  {
> -    memset(new_ire, sizeof(*new_ire), 0);
> +    memset(new_ire, 0, sizeof(*new_ire));

Thanks for the fix.

Acked-by: Feng Wu <feng.wu@xxxxxxxxx>

Thanks,
Feng

> 
>      /*
>       * 'im' filed decides whether the irte is in posted format (with value 1)
> --
> 2.1.4


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.