Patch "openrisc: Fix a memory leak" has been added to the 4.4-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

    openrisc: Fix a memory leak

to the 4.4-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:
     openrisc-fix-a-memory-leak.patch
and it can be found in the queue-4.4 subdirectory.

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



commit 1ccf314452e5baf24903c7386b8b0ec34bdb88ee
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Fri Apr 23 17:09:28 2021 +0200

    openrisc: Fix a memory leak
    
    [ Upstream commit c019d92457826bb7b2091c86f36adb5de08405f9 ]
    
    'setup_find_cpu_node()' take a reference on the node it returns.
    This reference must be decremented when not needed anymore, or there will
    be a leak.
    
    Add the missing 'of_node_put(cpu)'.
    
    Note that 'setup_cpuinfo()' that also calls this function already has a
    correct 'of_node_put(cpu)' at its end.
    
    Fixes: 9d02a4283e9c ("OpenRISC: Boot code")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Signed-off-by: Stafford Horne <shorne@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index b4ed8b36e078..e5f5b69a7b7b 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -278,6 +278,8 @@ void calibrate_delay(void)
 	pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
 		loops_per_jiffy / (500000 / HZ),
 		(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
+
+	of_node_put(cpu);
 }
 
 void __init setup_arch(char **cmdline_p)



[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