diff options
author | David S. Miller <davem@davemloft.net> | 2010-01-23 01:45:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-23 01:45:46 -0500 |
commit | 6be325719b3e54624397e413efd4b33a997e55a3 (patch) | |
tree | 57f321a56794cab2222e179b16731e0d76a4a68a /sound/oss/dev_table.c | |
parent | 26d92f9276a56d55511a427fb70bd70886af647a (diff) | |
parent | 92dcffb916d309aa01778bf8963a6932e4014d07 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'sound/oss/dev_table.c')
-rw-r--r-- | sound/oss/dev_table.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c index 08274c995d06..727bdb9ba2dc 100644 --- a/sound/oss/dev_table.c +++ b/sound/oss/dev_table.c | |||
@@ -67,14 +67,15 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver, | |||
67 | return -(EBUSY); | 67 | return -(EBUSY); |
68 | } | 68 | } |
69 | d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver))); | 69 | d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver))); |
70 | 70 | sound_nblocks++; | |
71 | if (sound_nblocks < 1024) | 71 | if (sound_nblocks >= MAX_MEM_BLOCKS) |
72 | sound_nblocks++; | 72 | sound_nblocks = MAX_MEM_BLOCKS - 1; |
73 | 73 | ||
74 | op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); | 74 | op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); |
75 | sound_nblocks++; | ||
76 | if (sound_nblocks >= MAX_MEM_BLOCKS) | ||
77 | sound_nblocks = MAX_MEM_BLOCKS - 1; | ||
75 | 78 | ||
76 | if (sound_nblocks < 1024) | ||
77 | sound_nblocks++; | ||
78 | if (d == NULL || op == NULL) { | 79 | if (d == NULL || op == NULL) { |
79 | printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); | 80 | printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); |
80 | sound_unload_audiodev(num); | 81 | sound_unload_audiodev(num); |
@@ -128,9 +129,10 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver, | |||
128 | until you unload sound! */ | 129 | until you unload sound! */ |
129 | 130 | ||
130 | op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); | 131 | op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); |
132 | sound_nblocks++; | ||
133 | if (sound_nblocks >= MAX_MEM_BLOCKS) | ||
134 | sound_nblocks = MAX_MEM_BLOCKS - 1; | ||
131 | 135 | ||
132 | if (sound_nblocks < 1024) | ||
133 | sound_nblocks++; | ||
134 | if (op == NULL) { | 136 | if (op == NULL) { |
135 | printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); | 137 | printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); |
136 | return -ENOMEM; | 138 | return -ENOMEM; |