Skip to content

Commit

Permalink
[PATCH] maestro3 vfree NULL check fixup
Browse files Browse the repository at this point in the history
vfree() checks for NULL, no need to do it explicitly.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Zach Brown <zab@zabbo.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Mar 28, 2006
1 parent 457d3d4 commit 07e0e93
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sound/oss/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2582,15 +2582,9 @@ static int alloc_dsp_suspendmem(struct m3_card *card)

return 0;
}
static void free_dsp_suspendmem(struct m3_card *card)
{
if(card->suspend_mem)
vfree(card->suspend_mem);
}

#else
#define alloc_dsp_suspendmem(args...) 0
#define free_dsp_suspendmem(args...)
#endif

/*
Expand Down Expand Up @@ -2717,7 +2711,7 @@ static int __devinit m3_probe(struct pci_dev *pci_dev, const struct pci_device_i
if(ret) {
if(card->iobase)
release_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0));
free_dsp_suspendmem(card);
vfree(card->suspend_mem);
if(card->ac97) {
unregister_sound_mixer(card->ac97->dev_mixer);
kfree(card->ac97);
Expand Down Expand Up @@ -2760,7 +2754,7 @@ static void m3_remove(struct pci_dev *pci_dev)
}

release_region(card->iobase, 256);
free_dsp_suspendmem(card);
vfree(card->suspend_mem);
kfree(card);
}
devs = NULL;
Expand Down

0 comments on commit 07e0e93

Please sign in to comment.