aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/util_mem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 12:16:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 12:16:54 -0400
commitd3570a5a7b8d0604fa012129f92637dc1534f62c (patch)
tree15d290595c363a2bdd4f4d6b3a2f7433e6e48f6d /sound/synth/util_mem.c
parent37d9869ed928268409b48f52c57449918c0fd307 (diff)
parent72474be62d6ec2e0337ff01ecbd737f9c5c242c7 (diff)
Merge branch 'for-linus' of git://git.alsa-project.org/alsa-kernel
* 'for-linus' of git://git.alsa-project.org/alsa-kernel: (258 commits) ALSA: hda: VREF powerdown for headphones ALSA: hda: STAC_HP_M4 ALSA: ASoC: Check for machine type in GTA01 machine driver ALSA: mtpav - Fix race in probe ALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirk ALSA: Add a note on dependency of RTC stuff ALSA: ASoC: add new param mux to dapm_mux_update_power ALSA: Increase components array size ALSA: ASoC: Correct inverted Mic PGA Switch control in wm8510 driver ALSA: hda: comment typo fix ALSA: hda: comment typo fix ALSA: hda - Fix PCI SSID for ASROCK K18N78FullHD-hSLI ALSA: snd-usb-audio: support for Edirol UA-4FX device ALSA: usb - Fix possible Oops at USB-MIDI disconnection ALSA: hda - Fix another ALC889A (rev 0x100101) ALSA: hda: add more board-specific information for Realtek ALC662 rev1 ALSA: Correct Vladimir Barinov's e-mail address ALSA: cs46xx: Add PCI IDs for TerraTec and Hercules cards ALSA: hda: SPDIF stream muting support ALSA: hda: appletv support ...
Diffstat (limited to 'sound/synth/util_mem.c')
-rw-r--r--sound/synth/util_mem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c
index deabe5f899c4..c85522e3808d 100644
--- a/sound/synth/util_mem.c
+++ b/sound/synth/util_mem.c
@@ -55,7 +55,8 @@ void snd_util_memhdr_free(struct snd_util_memhdr *hdr)
55{ 55{
56 struct list_head *p; 56 struct list_head *p;
57 57
58 snd_assert(hdr != NULL, return); 58 if (!hdr)
59 return;
59 /* release all blocks */ 60 /* release all blocks */
60 while ((p = hdr->block.next) != &hdr->block) { 61 while ((p = hdr->block.next) != &hdr->block) {
61 list_del(p); 62 list_del(p);
@@ -74,8 +75,8 @@ __snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
74 unsigned int units, prev_offset; 75 unsigned int units, prev_offset;
75 struct list_head *p; 76 struct list_head *p;
76 77
77 snd_assert(hdr != NULL, return NULL); 78 if (snd_BUG_ON(!hdr || size <= 0))
78 snd_assert(size > 0, return NULL); 79 return NULL;
79 80
80 /* word alignment */ 81 /* word alignment */
81 units = size; 82 units = size;
@@ -161,7 +162,8 @@ __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
161 */ 162 */
162int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk) 163int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
163{ 164{
164 snd_assert(hdr && blk, return -EINVAL); 165 if (snd_BUG_ON(!hdr || !blk))
166 return -EINVAL;
165 167
166 mutex_lock(&hdr->block_mutex); 168 mutex_lock(&hdr->block_mutex);
167 __snd_util_mem_free(hdr, blk); 169 __snd_util_mem_free(hdr, blk);