Patch "irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     irqchip-wpcm450-fix-memory-leak-in-wpcm450_aic_of_in.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 83381add4be74e2ab6b95555e2d94ceb2d8cbcc0
Author: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Date:   Tue Nov 15 09:25:32 2022 +0000

    irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()
    
    [ Upstream commit 4208d4faf36573a507b5e5de17abe342e9276759 ]
    
    If of_iomap() failed, 'aic' should be freed before return. Otherwise
    there is a memory leak.
    
    Fixes: fead4dd49663 ("irqchip: Add driver for WPCM450 interrupt controller")
    Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
    Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
    Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221115092532.1704032-1-weiyongjun@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/irqchip/irq-wpcm450-aic.c b/drivers/irqchip/irq-wpcm450-aic.c
index f3ac392d5bc8..36d0d0cf3fa2 100644
--- a/drivers/irqchip/irq-wpcm450-aic.c
+++ b/drivers/irqchip/irq-wpcm450-aic.c
@@ -146,6 +146,7 @@ static int __init wpcm450_aic_of_init(struct device_node *node,
 	aic->regs = of_iomap(node, 0);
 	if (!aic->regs) {
 		pr_err("Failed to map WPCM450 AIC registers\n");
+		kfree(aic);
 		return -ENOMEM;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux