From ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 26 Aug 2015 12:17:18 +0100 Subject: maint: avoid useless "if (foo) free(foo)" pattern The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by: Daniel P. Berrange Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- hw/usb/hcd-xhci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hw/usb/hcd-xhci.c') diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index c673bed..1c57e20 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1453,9 +1453,7 @@ static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report) t->running_retry = 0; killed = 1; } - if (t->trbs) { - g_free(t->trbs); - } + g_free(t->trbs); t->trbs = NULL; t->trb_count = t->trb_alloced = 0; -- cgit v1.1