[ALSA] Fix seq_clientmgr dereferences before NULL check
authorEugene Teo <eugene.teo@eugeneteo.net>
Fri, 17 Mar 2006 15:32:17 +0000 (16:32 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:39:23 +0000 (10:39 +0100)
Modules: ALSA sequencer

cptr->pool must be non-NULL there, so just the if (cptr->pool) is
superfluous. Thanks Takashi.

Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_clientmgr.c

index aae6420f5948700ecef66a395c2645ea586fd69a..bb15d9ee8842a05c60ae31528b80defe8b3eb4ad 100644 (file)
@@ -1866,8 +1866,7 @@ static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client,
        info.output_pool = cptr->pool->size;
        info.output_room = cptr->pool->room;
        info.output_free = info.output_pool;
-       if (cptr->pool)
-               info.output_free = snd_seq_unused_cells(cptr->pool);
+       info.output_free = snd_seq_unused_cells(cptr->pool);
        if (cptr->type == USER_CLIENT) {
                info.input_pool = cptr->data.user.fifo_pool_size;
                info.input_free = info.input_pool;