From: Charles Keepax Date: Wed, 4 May 2016 13:59:09 +0000 (+0100) Subject: ALSA: compress: Remove pointless NULL check X-Git-Tag: v4.7-rc1~116^2~4^2~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5bd05390ff084d7a1ea7efa8f8dc111c24b2454c;p=karo-tx-linux.git ALSA: compress: Remove pointless NULL check stream can't be NULL here as we have just taken the address of it, so no need for the check. Signed-off-by: Charles Keepax Acked-by: Vinod Koul Signed-off-by: Takashi Iwai --- diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 5268546d6935..5215df2940b3 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -392,9 +392,8 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait) if (snd_BUG_ON(!data)) return -EFAULT; + stream = &data->stream; - if (snd_BUG_ON(!stream)) - return -EFAULT; mutex_lock(&stream->device->lock); if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { @@ -799,9 +798,9 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg) if (snd_BUG_ON(!data)) return -EFAULT; + stream = &data->stream; - if (snd_BUG_ON(!stream)) - return -EFAULT; + mutex_lock(&stream->device->lock); switch (_IOC_NR(cmd)) { case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):