Skip to content

Commit

Permalink
swiotlb-xen: avoid double free
Browse files Browse the repository at this point in the history
commit ce6a80d upstream.

Of the two paths leading to the "error" label in xen_swiotlb_init() one
didn't allocate anything, while the other did already free what was
allocated.

Fixes: b827760 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/ce9c2adb-8a52-6293-982a-0d6ece943ac6@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jbeulich authored and gregkh committed Sep 22, 2021
1 parent 71e32ed commit 4eb0545
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/xen/swiotlb-xen.c
Expand Up @@ -216,7 +216,6 @@ int __ref xen_swiotlb_init(void)
goto retry;
}
pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);
free_pages((unsigned long)start, order);
return rc;
}

Expand Down

0 comments on commit 4eb0545

Please sign in to comment.