aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-10 15:42:14 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-10 15:42:14 +0100
commitec0e9937aaa8b0a4b0633711c4d70d622acd9a7f (patch)
tree7c19729d7bbd4d97784b45b2e2ec1b13dd005dd6 /sound/core/rawmidi.c
parentALSA: seq: Drop superfluous error/debug messages after malloc failures (diff)
downloadlinux-dev-ec0e9937aaa8b0a4b0633711c4d70d622acd9a7f.tar.xz
linux-dev-ec0e9937aaa8b0a4b0633711c4d70d622acd9a7f.zip
ALSA: core: Drop superfluous error/debug messages after malloc failures
The kernel memory allocators already report the errors when the requested allocation fails, thus we don't need to warn it again in each caller side. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index b5a748596fc4..a7759846fbaa 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1429,10 +1429,8 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi,
for (idx = 0; idx < count; idx++) {
substream = kzalloc(sizeof(*substream), GFP_KERNEL);
- if (substream == NULL) {
- rmidi_err(rmidi, "rawmidi: cannot allocate substream\n");
+ if (!substream)
return -ENOMEM;
- }
substream->stream = direction;
substream->number = idx;
substream->rmidi = rmidi;
@@ -1479,10 +1477,8 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device,
if (rrawmidi)
*rrawmidi = NULL;
rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL);
- if (rmidi == NULL) {
- dev_err(card->dev, "rawmidi: cannot allocate\n");
+ if (!rmidi)
return -ENOMEM;
- }
rmidi->card = card;
rmidi->device = device;
mutex_init(&rmidi->open_mutex);