]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 21:14:51 +0000 (22:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 21:14:51 +0000 (22:14 +0100)
added patches:
mmc-core-fix-return-value-check-in-devm_mmc_alloc_host.patch

queue-5.10/mmc-core-fix-return-value-check-in-devm_mmc_alloc_host.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/mmc-core-fix-return-value-check-in-devm_mmc_alloc_host.patch b/queue-5.10/mmc-core-fix-return-value-check-in-devm_mmc_alloc_host.patch
new file mode 100644 (file)
index 0000000..3e61a68
--- /dev/null
@@ -0,0 +1,46 @@
+From 71d04535e853305a76853b28a01512a62006351d Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Fri, 17 Feb 2023 10:43:33 +0800
+Subject: mmc: core: fix return value check in devm_mmc_alloc_host()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 71d04535e853305a76853b28a01512a62006351d upstream.
+
+mmc_alloc_host() returns NULL pointer not PTR_ERR(), if it
+fails, so replace the IS_ERR() check with NULL pointer check.
+
+In commit 418f7c2de133 ("mmc: meson-gx: use devm_mmc_alloc_host"),
+it checks NULL pointer not PTR_ERR, if devm_mmc_alloc_host() fails,
+so make it to return NULL pointer to keep same with mmc_alloc_host(),
+the drivers don't need to change the error handle when switch to
+use devm_mmc_alloc_host().
+
+Fixes: 80df83c2c57e ("mmc: core: add devm_mmc_alloc_host")
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
+Link: https://lore.kernel.org/r/20230217024333.4018279-1-yangyingliang@huawei.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/core/host.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/mmc/core/host.c
++++ b/drivers/mmc/core/host.c
+@@ -523,12 +523,12 @@ struct mmc_host *devm_mmc_alloc_host(str
+       dr = devres_alloc(devm_mmc_host_release, sizeof(*dr), GFP_KERNEL);
+       if (!dr)
+-              return ERR_PTR(-ENOMEM);
++              return NULL;
+       host = mmc_alloc_host(extra, dev);
+-      if (IS_ERR(host)) {
++      if (!host) {
+               devres_free(dr);
+-              return host;
++              return NULL;
+       }
+       *dr = host;
index 673ea0c2670fd0d84ed39405455e2bf3f9543a9e..45eddaa621ff8977e40e490c2dccc12f4457ad53 100644 (file)
@@ -10,3 +10,4 @@ ocfs2-fix-ubsan-warning-in-ocfs2_verify_volume.patch
 nilfs2-fix-null-ptr-deref-in-block_dirty_buffer-tracepoint.patch
 revert-mmc-dw_mmc-fix-idmac-operation-with-pages-bigger-than-4k.patch
 drm-bridge-tc358768-fix-dsi-command-tx.patch
+mmc-core-fix-return-value-check-in-devm_mmc_alloc_host.patch