Patch "ptp_qoriq: fix memory leak in probe()" 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

    ptp_qoriq: fix memory leak in probe()

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:
     ptp_qoriq-fix-memory-leak-in-probe.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 8f62f284bbc3cdd822c2167e7d9b1bbf10a45014
Author: SongJingyi <u201912584@xxxxxxxxxxx>
Date:   Fri Mar 24 11:14:06 2023 +0800

    ptp_qoriq: fix memory leak in probe()
    
    [ Upstream commit f33642224e38d7e0d59336e10e7b4e370b1c4506 ]
    
    Smatch complains that:
    drivers/ptp/ptp_qoriq.c ptp_qoriq_probe()
    warn: 'base' from ioremap() not released.
    
    Fix this by revising the parameter from 'ptp_qoriq->base' to 'base'.
    This is only a bug if ptp_qoriq_init() returns on the
    first -ENODEV error path.
    For other error paths ptp_qoriq->base and base are the same.
    And this change makes the code more readable.
    
    Fixes: 7f4399ba405b ("ptp_qoriq: fix NULL access if ptp dt node missing")
    Signed-off-by: SongJingyi <u201912584@xxxxxxxxxxx>
    Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>
    Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230324031406.1895159-1-u201912584@xxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index 08f4cf0ad9e3c..8fa9772acf79b 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -601,7 +601,7 @@ static int ptp_qoriq_probe(struct platform_device *dev)
 	return 0;
 
 no_clock:
-	iounmap(ptp_qoriq->base);
+	iounmap(base);
 no_ioremap:
 	release_resource(ptp_qoriq->rsrc);
 no_resource:



[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