]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Mon, 17 May 2021 03:14:58 +0000 (23:14 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 17 May 2021 03:14:58 +0000 (23:14 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch [new file with mode: 0644]
queue-4.14/blk-mq-swap-two-calls-in-blk_mq_exit_queue.patch [new file with mode: 0644]
queue-4.14/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/usb-fotg210-hcd-fix-an-error-message.patch [new file with mode: 0644]

diff --git a/queue-4.14/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch b/queue-4.14/acpi-scan-fix-a-memory-leak-in-an-error-handling-pat.patch
new file mode 100644 (file)
index 0000000..6089ddf
--- /dev/null
@@ -0,0 +1,36 @@
+From 0443fcd6d2121e79a0010d1dd026fac1b3b9829b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 8 May 2021 09:23:09 +0200
+Subject: ACPI: scan: Fix a memory leak in an error handling path
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ 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@wanadoo.fr>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/acpi/scan.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
+index 57a213466721..11f07f525b13 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.14/blk-mq-swap-two-calls-in-blk_mq_exit_queue.patch b/queue-4.14/blk-mq-swap-two-calls-in-blk_mq_exit_queue.patch
new file mode 100644 (file)
index 0000000..8d0624d
--- /dev/null
@@ -0,0 +1,51 @@
+From fa8c2130f183d059ab7c008220bd2c97460a3384 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 May 2021 10:15:29 -0700
+Subject: blk-mq: Swap two calls in blk_mq_exit_queue()
+
+From: Bart Van Assche <bvanassche@acm.org>
+
+[ Upstream commit 630ef623ed26c18a457cdc070cf24014e50129c2 ]
+
+If a tag set is shared across request queues (e.g. SCSI LUNs) then the
+block layer core keeps track of the number of active request queues in
+tags->active_queues. blk_mq_tag_busy() and blk_mq_tag_idle() update that
+atomic counter if the hctx flag BLK_MQ_F_TAG_QUEUE_SHARED is set. Make
+sure that blk_mq_exit_queue() calls blk_mq_tag_idle() before that flag is
+cleared by blk_mq_del_queue_tag_set().
+
+Cc: Christoph Hellwig <hch@infradead.org>
+Cc: Ming Lei <ming.lei@redhat.com>
+Cc: Hannes Reinecke <hare@suse.com>
+Fixes: 0d2602ca30e4 ("blk-mq: improve support for shared tags maps")
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Link: https://lore.kernel.org/r/20210513171529.7977-1-bvanassche@acm.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ block/blk-mq.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/block/blk-mq.c b/block/blk-mq.c
+index cf56bdad2e06..7b785855a6e4 100644
+--- a/block/blk-mq.c
++++ b/block/blk-mq.c
+@@ -2489,10 +2489,12 @@ EXPORT_SYMBOL(blk_mq_init_allocated_queue);
+ void blk_mq_free_queue(struct request_queue *q)
+ {
+-      struct blk_mq_tag_set   *set = q->tag_set;
++      struct blk_mq_tag_set *set = q->tag_set;
+-      blk_mq_del_queue_tag_set(q);
++      /* Checks hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED. */
+       blk_mq_exit_hw_queues(q, set, set->nr_hw_queues);
++      /* May clear BLK_MQ_F_TAG_QUEUE_SHARED in hctx->flags. */
++      blk_mq_del_queue_tag_set(q);
+ }
+ /* Basically redo blk_mq_init_queue with queue frozen */
+-- 
+2.30.2
+
diff --git a/queue-4.14/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch b/queue-4.14/iio-proximity-pulsedlight-fix-rumtime-pm-imbalance-o.patch
new file mode 100644 (file)
index 0000000..5b8702b
--- /dev/null
@@ -0,0 +1,37 @@
+From 2cc592173ea9a97d621da77b6176be5d988d8c32 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 12 Apr 2021 13:32:02 +0800
+Subject: iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
+
+From: Dinghao Liu <dinghao.liu@zju.edu.cn>
+
+[ 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 <dinghao.liu@zju.edu.cn>
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Link: https://lore.kernel.org/r/20210412053204.4889-1-dinghao.liu@zju.edu.cn
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 36c1ddc251aa..c033db701bb5 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
+
index a73629efd1a54706ef04e618f9860d9c4816bfe2..9f8519f0d12276c918ddc1876983e8ca124f5938 100644 (file)
@@ -279,3 +279,7 @@ powerpc-64s-fix-crashes-when-toggling-entry-flush-barrier.patch
 squashfs-fix-divide-error-in-calculate_skip.patch
 userfaultfd-release-page-in-error-path-to-avoid-bug_on.patch
 drm-radeon-dpm-disable-sclk-switching-on-oland-when-two-4k-60hz-monitors-are-connected.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
+blk-mq-swap-two-calls-in-blk_mq_exit_queue.patch
diff --git a/queue-4.14/usb-fotg210-hcd-fix-an-error-message.patch b/queue-4.14/usb-fotg210-hcd-fix-an-error-message.patch
new file mode 100644 (file)
index 0000000..2ed880e
--- /dev/null
@@ -0,0 +1,53 @@
+From 4a157b32b50cbe4530f0defef6d86c4811cb6425 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 May 2021 22:39:10 +0200
+Subject: usb: fotg210-hcd: Fix an error message
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ 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 <christophe.jaillet@wanadoo.fr>
+Link: https://lore.kernel.org/r/94531bcff98e46d4f9c20183a90b7f47f699126c.1620333419.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 aa2103682808..bbe1ea00d887 100644
+--- a/drivers/usb/host/fotg210-hcd.c
++++ b/drivers/usb/host/fotg210-hcd.c
+@@ -5598,7 +5598,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())
+@@ -5618,7 +5618,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
+