Module Name: src
Committed By: maya
Date: Sat Dec 10 16:08:04 UTC 2016
Modified Files:
src/sys/dev: audio.c
Log Message:
remove redundant null check
allocating with KM_SLEEP can't fail
To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.271 src/sys/dev/audio.c:1.272
--- src/sys/dev/audio.c:1.271 Fri Dec 9 13:06:02 2016
+++ src/sys/dev/audio.c Sat Dec 10 16:08:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.271 2016/12/09 13:06:02 martin Exp $ */
+/* $NetBSD: audio.c,v 1.272 2016/12/10 16:08:04 maya Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <[email protected]>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.271 2016/12/09 13:06:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.272 2016/12/10 16:08:04 maya Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -1331,8 +1331,6 @@ audio_stream_ctor(audio_stream_t *stream
size = min(size, AU_RING_SIZE);
stream->bufsize = size;
stream->start = kmem_zalloc(size, KM_SLEEP);
- if (stream->start == NULL)
- return ENOMEM;
frame_size = (param->precision + 7) / 8 * param->channels;
size = (size / frame_size) * frame_size;
stream->end = stream->start + size;
@@ -1864,8 +1862,6 @@ audio_open(dev_t dev, struct audio_softc
return ENXIO;
sc->sc_vchan[n] = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP);
- if (sc->sc_vchan[n] == NULL)
- return ENOMEM;
vc = sc->sc_vchan[n];
vc->sc_open = 0;