Patch "ACPI: scan: Fix a memory leak in an error handling path" has been added to the 4.9-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

    ACPI: scan: Fix a memory leak in an error handling path

to the 4.9-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:
     acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch
and it can be found in the queue-4.9 subdirectory.

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



commit 1e300e9575dbf7dc59aa4b84e187642b8da98d75
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sat May 8 09:23:09 2021 +0200

    ACPI: scan: Fix a memory leak in an error handling path
    
    [ Upstream commit 0c8bd174f0fc131bc9dfab35cd8784f59045da87 ]
    
    If 'acpi_device_set_name()' fails, we must free
    'acpi_device_bus_id->bus_id' or there is a (potential) memory leak.
    
    Fixes: eb50aaf960e3 ("ACPI: scan: Use unique number for instance_no")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d749fe20fbfc..89ce7b14a166 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -704,6 +704,7 @@ int acpi_device_add(struct acpi_device *device,
 
 		result = acpi_device_set_name(device, acpi_device_bus_id);
 		if (result) {
+			kfree_const(acpi_device_bus_id->bus_id);
 			kfree(acpi_device_bus_id);
 			goto err_unlock;
 		}



[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