summaryrefslogtreecommitdiffstats
path: root/hw/sd/sdhci.c
diff options
context:
space:
mode:
authorMarkus Armbruster2015-08-26 14:02:53 +0200
committerMichael Tokarev2015-09-11 09:21:38 +0200
commit012aef073461fd24a901d7a8742532093b7f6ae5 (patch)
tree4ee28d5cedea44f2af2b5b3a7fe482d9e80a3fad /hw/sd/sdhci.c
parentmaint: avoid useless "if (foo) free(foo)" pattern (diff)
downloadqemu-012aef073461fd24a901d7a8742532093b7f6ae5.tar.gz
qemu-012aef073461fd24a901d7a8742532093b7f6ae5.tar.xz
qemu-012aef073461fd24a901d7a8742532093b7f6ae5.zip
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/sd/sdhci.c')
-rw-r--r--hw/sd/sdhci.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index e63367ba56..65304cff5e 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1169,10 +1169,8 @@ static void sdhci_uninitfn(SDHCIState *s)
qemu_free_irq(s->eject_cb);
qemu_free_irq(s->ro_cb);
- if (s->fifo_buffer) {
- g_free(s->fifo_buffer);
- s->fifo_buffer = NULL;
- }
+ g_free(s->fifo_buffer);
+ s->fifo_buffer = NULL;
}
const VMStateDescription sdhci_vmstate = {