diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-08-26 14:02:53 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2015-09-11 10:21:38 +0300 |
commit | 012aef073461fd24a901d7a8742532093b7f6ae5 (patch) | |
tree | 4ee28d5cedea44f2af2b5b3a7fe482d9e80a3fad /hw/usb/hcd-ehci-pci.c | |
parent | ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 (diff) | |
download | qemu-012aef073461fd24a901d7a8742532093b7f6ae5.zip qemu-012aef073461fd24a901d7a8742532093b7f6ae5.tar.gz qemu-012aef073461fd24a901d7a8742532093b7f6ae5.tar.bz2 |
maint: avoid useless "if (foo) free(foo)" pattern
My Coccinelle semantic patch finds a few more, because it also fixes up
the equally pointless conditional
if (foo) {
free(foo);
foo = NULL;
}
Result (feel free to squash it into your patch):
Signed-off-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/hcd-ehci-pci.c')
-rw-r--r-- | hw/usb/hcd-ehci-pci.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 7afa5f9..16fb845 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -95,10 +95,8 @@ static void usb_ehci_pci_exit(PCIDevice *dev) usb_ehci_unrealize(s, DEVICE(dev), NULL); - if (s->irq) { - g_free(s->irq); - s->irq = NULL; - } + g_free(s->irq); + s->irq = NULL; } static void usb_ehci_pci_reset(DeviceState *dev) |