Patch "rtc: tps6594: Fix memleak in probe" has been added to the 6.10-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

    rtc: tps6594: Fix memleak in probe

to the 6.10-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:
     rtc-tps6594-fix-memleak-in-probe.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 002abad5904abdfbb35cf04308a3aed847a61625
Author: Richard Genoud <richard.genoud@xxxxxxxxxxx>
Date:   Tue Jun 18 16:18:49 2024 +0200

    rtc: tps6594: Fix memleak in probe
    
    [ Upstream commit 94d4154792abf30ee6081d35beaeef035816e294 ]
    
    struct rtc_device is allocated twice in probe(), once with
    devm_kzalloc(), and then with devm_rtc_allocate_device().
    
    The allocation with devm_kzalloc() is lost and superfluous.
    
    Fixes: 9f67c1e63976 ("rtc: tps6594: Add driver for TPS6594 RTC")
    Signed-off-by: Richard Genoud <richard.genoud@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240618141851.1810000-2-richard.genoud@xxxxxxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/rtc/rtc-tps6594.c b/drivers/rtc/rtc-tps6594.c
index 838ae8562a351..bc8dc735aa238 100644
--- a/drivers/rtc/rtc-tps6594.c
+++ b/drivers/rtc/rtc-tps6594.c
@@ -360,10 +360,6 @@ static int tps6594_rtc_probe(struct platform_device *pdev)
 	int irq;
 	int ret;
 
-	rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
-	if (!rtc)
-		return -ENOMEM;
-
 	rtc = devm_rtc_allocate_device(dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);




[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