diff options
author | Daniel P. Berrange | 2015-08-26 13:17:18 +0200 |
---|---|---|
committer | Michael Tokarev | 2015-09-11 09:21:38 +0200 |
commit | ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 (patch) | |
tree | 0b0f9a746055b66019016ed2d8e4ff9df7d79a8c /hw/usb | |
parent | maint: remove unused include for strings.h (diff) | |
download | qemu-ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374.tar.gz qemu-ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374.tar.xz qemu-ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374.zip |
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 <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/hcd-xhci.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index c673bed4c4..1c57e20e70 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; |