Patch "firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()" 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

    firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()

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:
     firmware-stratix10-svc-fix-a-potential-resource-leak-in-svc_create_memory_pool.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.


>From 1995f15590ca222f91193ed11461862b450abfd6 Mon Sep 17 00:00:00 2001
From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date: Tue, 13 Jun 2023 16:15:21 -0500
Subject: firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()

From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>

commit 1995f15590ca222f91193ed11461862b450abfd6 upstream.

svc_create_memory_pool() is only called from stratix10_svc_drv_probe().
Most of resources in the probe are managed, but not this memremap() call.

There is also no memunmap() call in the file.

So switch to devm_memremap() to avoid a resource leak.

Cc: stable@xxxxxxxxxxxxxxx
Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
Link: https://lore.kernel.org/all/783e9dfbba34e28505c9efa8bba41f97fd0fa1dc.1686109400.git.christophe.jaillet@xxxxxxxxxx/
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Signed-off-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>
Message-ID: <20230613211521.16366-1-dinguyen@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/firmware/stratix10-svc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -622,7 +622,7 @@ svc_create_memory_pool(struct platform_d
 	end = rounddown(sh_memory->addr + sh_memory->size, PAGE_SIZE);
 	paddr = begin;
 	size = end - begin;
-	va = memremap(paddr, size, MEMREMAP_WC);
+	va = devm_memremap(dev, paddr, size, MEMREMAP_WC);
 	if (!va) {
 		dev_err(dev, "fail to remap shared memory\n");
 		return ERR_PTR(-EINVAL);


Patches currently in stable-queue which might be from christophe.jaillet@xxxxxxxxxx are

queue-5.15/wifi-ray_cs-fix-an-error-handling-path-in-ray_probe.patch
queue-5.15/ib-hfi1-use-bitmap_zalloc-when-applicable.patch
queue-5.15/wifi-orinoco-fix-an-error-handling-path-in-orinoco_c.patch
queue-5.15/tty-serial-samsung_tty-fix-a-memory-leak-in-s3c24xx_serial_getclk-when-iterating-clk.patch
queue-5.15/usb-dwc3-qcom-fix-an-error-handling-path-in-dwc3_qco.patch
queue-5.15/usb-dwc3-qcom-release-the-correct-resources-in-dwc3_.patch
queue-5.15/wifi-orinoco-fix-an-error-handling-path-in-spectrum_.patch
queue-5.15/firmware-stratix10-svc-fix-a-potential-resource-leak-in-svc_create_memory_pool.patch
queue-5.15/wifi-mwifiex-fix-the-size-of-a-memory-allocation-in-.patch
queue-5.15/thermal-drivers-sun8i-fix-some-error-handling-paths-.patch
queue-5.15/tty-serial-samsung_tty-fix-a-memory-leak-in-s3c24xx_serial_getclk-in-case-of-error.patch
queue-5.15/pinctrl-bcm2835-handle-gpiochip_add_pin_range-errors.patch
queue-5.15/fbdev-omapfb-lcd_mipid-fix-an-error-handling-path-in.patch
queue-5.15/wifi-atmel-fix-an-error-handling-path-in-atmel_probe.patch
queue-5.15/mfd-stmpe-only-disable-the-regulators-if-they-are-en.patch
queue-5.15/usb-dwc2-fix-some-error-handling-paths.patch
queue-5.15/rtc-st-lpc-release-some-resources-in-st_rtc_probe-in.patch
queue-5.15/usb-dwc3-meson-g12a-fix-an-error-handling-path-in-dw.patch
queue-5.15/wifi-wl3501_cs-fix-an-error-handling-path-in-wl3501_.patch



[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