]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2023 13:03:23 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2023 13:03:23 +0000 (15:03 +0200)
added patches:
pcd-fix-error-codes-in-pcd_init_unit.patch

queue-5.15/pcd-fix-error-codes-in-pcd_init_unit.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/pcd-fix-error-codes-in-pcd_init_unit.patch b/queue-5.15/pcd-fix-error-codes-in-pcd_init_unit.patch
new file mode 100644 (file)
index 0000000..78bd20e
--- /dev/null
@@ -0,0 +1,56 @@
+From d0ac7a30e41174c794fbfa53ea986d9555e5b9f4 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Fri, 1 Oct 2021 15:26:23 +0300
+Subject: pcd: fix error codes in pcd_init_unit()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit d0ac7a30e41174c794fbfa53ea986d9555e5b9f4 upstream.
+
+Return -ENODEV on these error paths instead of returning success.
+
+Fixes: af761f277b7f ("pcd: cleanup initialization")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Link: https://lore.kernel.org/r/20211001122623.GA2283@kili
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/block/paride/pcd.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/block/paride/pcd.c
++++ b/drivers/block/paride/pcd.c
+@@ -613,8 +613,7 @@ static int pcd_identify(struct pcd_unit
+ }
+ /*
+- * returns  0, with id set if drive is detected
+- *        -1, if drive detection failed
++ * returns 0, with id set if drive is detected, otherwise an error code.
+  */
+ static int pcd_probe(struct pcd_unit *cd, int ms)
+ {
+@@ -627,7 +626,7 @@ static int pcd_probe(struct pcd_unit *cd
+               if (!pcd_reset(cd) && !pcd_identify(cd))
+                       return 0;
+       }
+-      return -1;
++      return -ENODEV;
+ }
+ static int pcd_probe_capabilities(struct pcd_unit *cd)
+@@ -933,9 +932,12 @@ static int pcd_init_unit(struct pcd_unit
+       disk->event_flags = DISK_EVENT_FLAG_BLOCK_ON_EXCL_WRITE;
+       if (!pi_init(cd->pi, autoprobe, port, mode, unit, protocol, delay,
+-                      pcd_buffer, PI_PCD, verbose, cd->name))
++                      pcd_buffer, PI_PCD, verbose, cd->name)) {
++              ret = -ENODEV;
+               goto out_free_disk;
+-      if (pcd_probe(cd, ms))
++      }
++      ret = pcd_probe(cd, ms);
++      if (ret)
+               goto out_pi_release;
+       cd->present = 1;
index ebca2fb2702aed1c4db36b158a5524017a29ffe8..34c3a5a547f54872fb7173cdc7e74645731bf4cc 100644 (file)
@@ -507,3 +507,4 @@ ixgbe-fix-timestamp-configuration-code.patch
 kcm-fix-error-handling-for-sock_dgram-in-kcm_sendmsg.patch
 mips-only-fiddle-with-checkflags-if-need-compiler.patch
 drm-amd-display-fix-a-bug-when-searching-for-insert_above_mpcc.patch
+pcd-fix-error-codes-in-pcd_init_unit.patch