From: Jesper Juhl <jesper.juhl@gmail.com>
To: Zach Brown <zab@zabbo.net>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/13] maestro3 vfree NULL check fixup
Date: Fri, 24 Feb 2006 22:17:21 +0100 [thread overview]
Message-ID: <200602242217.21180.jesper.juhl@gmail.com> (raw)
In-Reply-To: <43FF7615.8020504@zabbo.net>
On Friday 24 February 2006 22:09, Zach Brown wrote:
> Jesper Juhl wrote:
> > vfree() checks for NULL, no need to do it explicitly.
>
> > static void free_dsp_suspendmem(struct m3_card *card)
> > {
> > - if(card->suspend_mem)
> > - vfree(card->suspend_mem);
> > + vfree(card->suspend_mem);
> > }
>
> eh, I'd just get rid of the helper and call vfree() from both sites.
>
makes perfect sense, I just looked for vfree use - should have checked more
in-depth.
Here's an updated patch :
Don't check pointers for NULL before calling vfree and get rid
of pointless helper function in sound/oss/maestro3.c
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
sound/oss/maestro3.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
--- linux-2.6.16-rc4-mm2-orig/sound/oss/maestro3.c 2006-02-24 19:25:49.000000000 +0100
+++ linux-2.6.16-rc4-mm2/sound/oss/maestro3.c 2006-02-24 22:12:27.000000000 +0100
@@ -2582,15 +2582,9 @@ static int alloc_dsp_suspendmem(struct m
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
/*
@@ -2717,7 +2711,7 @@ out:
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);
if(card->ac97) {
unregister_sound_mixer(card->ac97->dev_mixer);
kfree(card->ac97);
@@ -2760,7 +2754,7 @@ static void m3_remove(struct pci_dev *pc
}
release_region(card->iobase, 256);
- free_dsp_suspendmem(card);
+ vfree(card);
kfree(card);
}
devs = NULL;
next prev parent reply other threads:[~2006-02-24 21:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-24 20:48 [PATCH 07/13] maestro3 vfree NULL check fixup Jesper Juhl
2006-02-24 21:09 ` Zach Brown
2006-02-24 21:17 ` Jesper Juhl [this message]
2006-02-24 21:18 ` Jesper Juhl
2006-02-24 21:22 ` Jesper Juhl
2006-02-24 21:25 ` Zach Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602242217.21180.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zab@zabbo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.