dmar: fix double free in error paths following c/s a8bc99b
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Jul 2015 13:23:37 +0000 (15:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 16 Jul 2015 13:23:37 +0000 (15:23 +0200)
Several error paths would end up freeing scope->devices twice.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/vtd/dmar.c

index 8ed1e24d85ef3d72c6e0cb1ba99f6a8307a4e50b..267268860ad598bc1187665c29e4baf65dc511e0 100644 (file)
@@ -88,6 +88,7 @@ static void scope_devices_free(struct dmar_scope *scope)
 
     scope->devices_cnt = 0;
     xfree(scope->devices);
+    scope->devices = NULL;
 }
 
 static void __init disable_all_dmar_units(void)