]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: amd: acp: drop bogus NULL check from i2s_irq_handler
authorMurad Masimov <m.masimov@maxima.ru>
Tue, 1 Oct 2024 19:08:39 +0000 (22:08 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 2 Oct 2024 13:02:32 +0000 (14:02 +0100)
When i2s_irq_handler is called, it's guaranteed that adata is not NULL,
since IRQ handlers are guaranteed to be provided with a valid data pointer.
Moreover, adata pointer is being dereferenced right before the NULL check,
which makes the check pointless, even if adata could be NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Murad Masimov <m.masimov@maxima.ru>
Link: https://patch.msgid.link/20241001190848.711-1-m.masimov@maxima.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp/acp-platform.c

index 7be9b4ff79232daff271b97a09de0eaa61e48268..1f352b2b300231c710c1f49986d329c33836c223 100644 (file)
@@ -143,9 +143,6 @@ static irqreturn_t i2s_irq_handler(int irq, void *data)
        u16 i2s_flag = 0;
        u32 ext_intr_stat, ext_intr_stat1;
 
-       if (!adata)
-               return IRQ_NONE;
-
        if (adata->rsrc->no_of_ctrls == 2)
                ext_intr_stat1 = readl(ACP_EXTERNAL_INTR_STAT(adata, (rsrc->irqp_used - 1)));