mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: trident: Delete an error message for a failed memory allocation in snd_trident_tlb_alloc()
@ 2017-08-12 11:31 SF Markus Elfring
  2017-08-12 21:26 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-08-12 11:31 UTC (permalink / raw)
  To: alsa-devel, Bhumika Goyal, Fabian Frederick, Jaroslav Kysela,
	Julia Lawall, Takashi Iwai
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 12 Aug 2017 13:20:16 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 sound/pci/trident/trident_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 64d3b8eba4bb..0eca3c370990 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3363,11 +3363,9 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident)
 	trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4);
 	/* allocate shadow TLB page table (virtual addresses) */
 	trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long));
-	if (trident->tlb.shadow_entries == NULL) {
-		dev_err(trident->card->dev,
-			"unable to allocate shadow TLB entries\n");
+	if (!trident->tlb.shadow_entries)
 		return -ENOMEM;
-	}
+
 	/* allocate and setup silent page and initialise TLB entries */
 	if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci),
 				SNDRV_TRIDENT_PAGE_SIZE, &trident->tlb.silent_page) < 0) {
-- 
2.14.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: trident: Delete an error message for a failed memory allocation in snd_trident_tlb_alloc()
  2017-08-12 11:31 [PATCH] ALSA: trident: Delete an error message for a failed memory allocation in snd_trident_tlb_alloc() SF Markus Elfring
@ 2017-08-12 21:26 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-08-12 21:26 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: alsa-devel, Bhumika Goyal, Julia Lawall, Jaroslav Kysela,
	Fabian Frederick, kernel-janitors, LKML

On Sat, 12 Aug 2017 13:31:55 +0200,
SF Markus Elfring wrote:
> 
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 12 Aug 2017 13:20:16 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied, thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-12 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-12 11:31 [PATCH] ALSA: trident: Delete an error message for a failed memory allocation in snd_trident_tlb_alloc() SF Markus Elfring
2017-08-12 21:26 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®