From: Sasha Levin Date: Mon, 17 May 2021 03:14:58 +0000 (-0400) Subject: Fixes for 4.9 X-Git-Tag: v5.4.120~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99a30c9ba61c55e6c5da84b93497b6fad7d20fc3;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch b/queue-4.9/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch new file mode 100644 index 00000000000..a5a8a7ef946 --- /dev/null +++ b/queue-4.9/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch @@ -0,0 +1,36 @@ +From 1e300e9575dbf7dc59aa4b84e187642b8da98d75 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 8 May 2021 09:23:09 +0200 +Subject: ACPI: scan: Fix a memory leak in an error handling path + +From: Christophe JAILLET + +[ 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 +Reviewed-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/scan.c | 1 + + 1 file changed, 1 insertion(+) + +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; + } +-- +2.30.2 + diff --git a/queue-4.9/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch b/queue-4.9/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch new file mode 100644 index 00000000000..c45abd5718f --- /dev/null +++ b/queue-4.9/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch @@ -0,0 +1,37 @@ +From 57869ebebad702b11a7f37cbbf0f99b3f2fe0304 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Apr 2021 13:32:02 +0800 +Subject: iio: proximity: pulsedlight: Fix rumtime PM imbalance on error + +From: Dinghao Liu + +[ Upstream commit a2fa9242e89f27696515699fe0f0296bf1ac1815 ] + +When lidar_write_control() fails, a pairing PM usage counter +decrement is needed to keep the counter balanced. + +Fixes: 4ac4e086fd8c5 ("iio: pulsedlight-lidar-lite: add runtime PM") +Signed-off-by: Dinghao Liu +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20210412053204.4889-1-dinghao.liu@zju.edu.cn +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +index 3141c3c161bb..46e969a3a9b7 100644 +--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c ++++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +@@ -166,6 +166,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) + ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); + if (ret < 0) { + dev_err(&client->dev, "cannot send start measurement command"); ++ pm_runtime_put_noidle(&client->dev); + return ret; + } + +-- +2.30.2 + diff --git a/queue-4.9/series b/queue-4.9/series index ed34ef1e13b..cdaa9d9a1db 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -205,3 +205,6 @@ kernel-kexec_file-fix-error-return-code-of-kexec_cal.patch arc-entry-fix-off-by-one-error-in-syscall-number-validation.patch powerpc-64s-fix-crashes-when-toggling-entry-flush-barrier.patch squashfs-fix-divide-error-in-calculate_skip.patch +iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch +usb-fotg210-hcd-fix-an-error-message.patch +acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch diff --git a/queue-4.9/usb-fotg210-hcd-fix-an-error-message.patch b/queue-4.9/usb-fotg210-hcd-fix-an-error-message.patch new file mode 100644 index 00000000000..60e2e7d691d --- /dev/null +++ b/queue-4.9/usb-fotg210-hcd-fix-an-error-message.patch @@ -0,0 +1,53 @@ +From 3075c8c22fe781d8b68b491154a5cad4855b8878 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 6 May 2021 22:39:10 +0200 +Subject: usb: fotg210-hcd: Fix an error message + +From: Christophe JAILLET + +[ Upstream commit a60a34366e0d09ca002c966dd7c43a68c28b1f82 ] + +'retval' is known to be -ENODEV here. +This is a hard-coded default error code which is not useful in the error +message. Moreover, another error message is printed at the end of the +error handling path. The corresponding error code (-ENOMEM) is more +informative. + +So remove simplify the first error message. + +While at it, also remove the useless initialization of 'retval'. + +Fixes: 7d50195f6c50 ("usb: host: Faraday fotg210-hcd driver") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/94531bcff98e46d4f9c20183a90b7f47f699126c.1620333419.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/fotg210-hcd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c +index 72853020a542..15249e664b89 100644 +--- a/drivers/usb/host/fotg210-hcd.c ++++ b/drivers/usb/host/fotg210-hcd.c +@@ -5599,7 +5599,7 @@ static int fotg210_hcd_probe(struct platform_device *pdev) + struct usb_hcd *hcd; + struct resource *res; + int irq; +- int retval = -ENODEV; ++ int retval; + struct fotg210_hcd *fotg210; + + if (usb_disabled()) +@@ -5619,7 +5619,7 @@ static int fotg210_hcd_probe(struct platform_device *pdev) + hcd = usb_create_hcd(&fotg210_fotg210_hc_driver, dev, + dev_name(dev)); + if (!hcd) { +- dev_err(dev, "failed to create hcd with err %d\n", retval); ++ dev_err(dev, "failed to create hcd\n"); + retval = -ENOMEM; + goto fail_create_hcd; + } +-- +2.30.2 +