mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
ALSA: usx2y: Delete an error message for a failed memory allocation in two functions
Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
841c1ea0d8
commit
6fd9ff7b01
1 changed files with 3 additions and 6 deletions
|
@ -419,11 +419,9 @@ static int usX2Y_urbs_allocate(struct snd_usX2Y_substream *subs)
|
||||||
|
|
||||||
if (is_playback && NULL == subs->tmpbuf) { /* allocate a temporary buffer for playback */
|
if (is_playback && NULL == subs->tmpbuf) { /* allocate a temporary buffer for playback */
|
||||||
subs->tmpbuf = kcalloc(nr_of_packs(), subs->maxpacksize, GFP_KERNEL);
|
subs->tmpbuf = kcalloc(nr_of_packs(), subs->maxpacksize, GFP_KERNEL);
|
||||||
if (NULL == subs->tmpbuf) {
|
if (!subs->tmpbuf)
|
||||||
snd_printk(KERN_ERR "cannot malloc tmpbuf\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* allocate and initialize data urbs */
|
/* allocate and initialize data urbs */
|
||||||
for (i = 0; i < NRURBS; i++) {
|
for (i = 0; i < NRURBS; i++) {
|
||||||
struct urb **purb = subs->urb + i;
|
struct urb **purb = subs->urb + i;
|
||||||
|
@ -949,10 +947,9 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,
|
||||||
for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
|
for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
|
||||||
i <= SNDRV_PCM_STREAM_CAPTURE; ++i) {
|
i <= SNDRV_PCM_STREAM_CAPTURE; ++i) {
|
||||||
usX2Y_substream[i] = kzalloc(sizeof(struct snd_usX2Y_substream), GFP_KERNEL);
|
usX2Y_substream[i] = kzalloc(sizeof(struct snd_usX2Y_substream), GFP_KERNEL);
|
||||||
if (NULL == usX2Y_substream[i]) {
|
if (!usX2Y_substream[i])
|
||||||
snd_printk(KERN_ERR "cannot malloc\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
usX2Y_substream[i]->usX2Y = usX2Y(card);
|
usX2Y_substream[i]->usX2Y = usX2Y(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue