Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142635898
D46845.id143899.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D46845.id143899.diff
View Options
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1298,12 +1298,7 @@
*/
if (c->direction == PCMDIR_PLAY) {
bs->sl = sndbuf_getmaxsize(bs);
- bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_NOWAIT);
- if (bs->shadbuf == NULL) {
- device_printf(d->dev, "%s(): failed to create shadow "
- "buffer\n", __func__);
- goto fail;
- }
+ bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_WAITOK);
}
PCM_LOCK(d);
diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c
--- a/sys/dev/sound/pcm/feeder.c
+++ b/sys/dev/sound/pcm/feeder.c
@@ -61,11 +61,7 @@
KASSERT(fc->desc == NULL, ("first feeder not root: %s", fc->name));
SLIST_INIT(&feedertab);
- fte = malloc(sizeof(*fte), M_FEEDER, M_NOWAIT | M_ZERO);
- if (fte == NULL) {
- printf("can't allocate memory for root feeder: %s\n", fc->name);
- return;
- }
+ fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO);
fte->feederclass = fc;
fte->desc = NULL;
fte->idx = feedercnt;
@@ -91,13 +87,7 @@
*/
i = 0;
while ((feedercnt < MAXFEEDERS) && (fc->desc[i].type > 0)) {
- fte = malloc(sizeof(*fte), M_FEEDER, M_NOWAIT | M_ZERO);
- if (fte == NULL) {
- printf("can't allocate memory for feeder '%s', "
- "%x -> %x\n",
- fc->name, fc->desc[i].in, fc->desc[i].out);
- return;
- }
+ fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO);
fte->feederclass = fc;
fte->desc = &fc->desc[i];
fte->idx = feedercnt;
@@ -147,7 +137,8 @@
struct pcm_feeder *f;
int err;
- f = (struct pcm_feeder *)kobj_create((kobj_class_t)fc, M_FEEDER, M_NOWAIT | M_ZERO);
+ f = (struct pcm_feeder *)kobj_create((kobj_class_t)fc,
+ M_FEEDER, M_WAITOK | M_ZERO);
if (f == NULL)
return NULL;
diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c
--- a/sys/dev/sound/pcm/feeder_eq.c
+++ b/sys/dev/sound/pcm/feeder_eq.c
@@ -353,9 +353,7 @@
if (biquad_op == NULL)
return (EINVAL);
- info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (info == NULL)
- return (ENOMEM);
+ info = malloc(sizeof(*info), M_DEVBUF, M_WAITOK | M_ZERO);
info->channels = AFMT_CHANNEL(f->desc->in);
info->align = info->channels * AFMT_BPS(f->desc->in);
diff --git a/sys/dev/sound/pcm/feeder_format.c b/sys/dev/sound/pcm/feeder_format.c
--- a/sys/dev/sound/pcm/feeder_format.c
+++ b/sys/dev/sound/pcm/feeder_format.c
@@ -147,9 +147,7 @@
return (EINVAL);
}
- info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (info == NULL)
- return (ENOMEM);
+ info = malloc(sizeof(*info), M_DEVBUF, M_WAITOK | M_ZERO);
info->channels = AFMT_CHANNEL(f->desc->in);
diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c
--- a/sys/dev/sound/pcm/feeder_matrix.c
+++ b/sys/dev/sound/pcm/feeder_matrix.c
@@ -402,10 +402,7 @@
if (AFMT_ENCODING(f->desc->in) != AFMT_ENCODING(f->desc->out))
return (EINVAL);
- info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (info == NULL)
- return (ENOMEM);
-
+ info = malloc(sizeof(*info), M_DEVBUF, M_WAITOK | M_ZERO);
info->in = f->desc->in;
info->out = f->desc->out;
info->bps = AFMT_BPS(info->in);
diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c
--- a/sys/dev/sound/pcm/feeder_rate.c
+++ b/sys/dev/sound/pcm/feeder_rate.c
@@ -1524,9 +1524,7 @@
if (f->desc->in != f->desc->out)
return (EINVAL);
- info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (info == NULL)
- return (ENOMEM);
+ info = malloc(sizeof(*info), M_DEVBUF, M_WAITOK | M_ZERO);
info->rsrc = Z_RATE_DEFAULT;
info->rdst = Z_RATE_DEFAULT;
diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c
--- a/sys/dev/sound/pcm/feeder_volume.c
+++ b/sys/dev/sound/pcm/feeder_volume.c
@@ -152,10 +152,7 @@
if (AFMT_ENCODING(f->desc->in) ==
feed_volume_info_tab[i].format) {
info = malloc(sizeof(*info), M_DEVBUF,
- M_NOWAIT | M_ZERO);
- if (info == NULL)
- return (ENOMEM);
-
+ M_WAITOK | M_ZERO);
info->bps = AFMT_BPS(f->desc->in);
info->channels = AFMT_CHANNEL(f->desc->in);
info->apply = feed_volume_info_tab[i].apply;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 22, 5:31 PM (6 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27857436
Default Alt Text
D46845.id143899.diff (4 KB)
Attached To
Mode
D46845: sound: Use M_WAITOK where possible
Attached
Detach File
Event Timeline
Log In to Comment