]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Tue, 18 Mar 2025 00:58:40 +0000 (20:58 -0400)
committerSasha Levin <sashal@kernel.org>
Tue, 18 Mar 2025 00:58:40 +0000 (20:58 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch [new file with mode: 0644]
queue-5.4/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch [new file with mode: 0644]
queue-5.4/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch b/queue-5.4/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch
new file mode 100644 (file)
index 0000000..6b88869
--- /dev/null
@@ -0,0 +1,55 @@
+From a62cb44919dd82faac6cd473465f72677433025e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 Mar 2025 20:53:08 +0100
+Subject: i2c: ali1535: Fix an error handling path in ali1535_probe()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit 9b5463f349d019a261f1e80803447efca3126151 ]
+
+If i2c_add_adapter() fails, the request_region() call in ali1535_setup()
+must be undone by a corresponding release_region() call, as done in the
+remove function.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
+Link: https://lore.kernel.org/r/0daf63d7a2ce74c02e2664ba805bbfadab7d25e5.1741031571.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-ali1535.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
+index a43deea390f5a..2e547b03e5c9b 100644
+--- a/drivers/i2c/busses/i2c-ali1535.c
++++ b/drivers/i2c/busses/i2c-ali1535.c
+@@ -490,6 +490,8 @@ MODULE_DEVICE_TABLE(pci, ali1535_ids);
+ static int ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id)
+ {
++      int ret;
++
+       if (ali1535_setup(dev)) {
+               dev_warn(&dev->dev,
+                       "ALI1535 not detected, module not inserted.\n");
+@@ -501,7 +503,15 @@ static int ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id)
+       snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name),
+               "SMBus ALI1535 adapter at %04x", ali1535_offset);
+-      return i2c_add_adapter(&ali1535_adapter);
++      ret = i2c_add_adapter(&ali1535_adapter);
++      if (ret)
++              goto release_region;
++
++      return 0;
++
++release_region:
++      release_region(ali1535_smba, ALI1535_SMB_IOSIZE);
++      return ret;
+ }
+ static void ali1535_remove(struct pci_dev *dev)
+-- 
+2.39.5
+
diff --git a/queue-5.4/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch b/queue-5.4/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch
new file mode 100644 (file)
index 0000000..d1f54c5
--- /dev/null
@@ -0,0 +1,55 @@
+From b2689419d3a13e3e0bf17de06edc0ad93ae994ce Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 Mar 2025 20:58:06 +0100
+Subject: i2c: ali15x3: Fix an error handling path in ali15x3_probe()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit 6e55caaf30c88209d097e575a169b1dface1ab69 ]
+
+If i2c_add_adapter() fails, the request_region() call in ali15x3_setup()
+must be undone by a corresponding release_region() call, as done in the
+remove function.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
+Link: https://lore.kernel.org/r/9b2090cbcc02659f425188ea05f2e02745c4e67b.1741031878.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-ali15x3.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
+index 02185a1cfa775..0cb78c47d800e 100644
+--- a/drivers/i2c/busses/i2c-ali15x3.c
++++ b/drivers/i2c/busses/i2c-ali15x3.c
+@@ -473,6 +473,8 @@ MODULE_DEVICE_TABLE (pci, ali15x3_ids);
+ static int ali15x3_probe(struct pci_dev *dev, const struct pci_device_id *id)
+ {
++      int ret;
++
+       if (ali15x3_setup(dev)) {
+               dev_err(&dev->dev,
+                       "ALI15X3 not detected, module not inserted.\n");
+@@ -484,7 +486,15 @@ static int ali15x3_probe(struct pci_dev *dev, const struct pci_device_id *id)
+       snprintf(ali15x3_adapter.name, sizeof(ali15x3_adapter.name),
+               "SMBus ALI15X3 adapter at %04x", ali15x3_smba);
+-      return i2c_add_adapter(&ali15x3_adapter);
++      ret = i2c_add_adapter(&ali15x3_adapter);
++      if (ret)
++              goto release_region;
++
++      return 0;
++
++release_region:
++      release_region(ali15x3_smba, ALI15X3_SMB_IOSIZE);
++      return ret;
+ }
+ static void ali15x3_remove(struct pci_dev *dev)
+-- 
+2.39.5
+
diff --git a/queue-5.4/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch b/queue-5.4/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch
new file mode 100644 (file)
index 0000000..7db8c00
--- /dev/null
@@ -0,0 +1,55 @@
+From e846caf98a228d40b523aa1f03a0d7b2b4e98ba7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 3 Mar 2025 21:26:54 +0100
+Subject: i2c: sis630: Fix an error handling path in sis630_probe()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit 2b22459792fcb4def9f0936d64575ac11a95a58d ]
+
+If i2c_add_adapter() fails, the request_region() call in sis630_setup()
+must be undone by a corresponding release_region() call, as done in the
+remove function.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Link: https://lore.kernel.org/r/3d607601f2c38e896b10207963c6ab499ca5c307.1741033587.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-sis630.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
+index cfb8e04a2a831..6befa6ff83f26 100644
+--- a/drivers/i2c/busses/i2c-sis630.c
++++ b/drivers/i2c/busses/i2c-sis630.c
+@@ -509,6 +509,8 @@ MODULE_DEVICE_TABLE(pci, sis630_ids);
+ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id)
+ {
++      int ret;
++
+       if (sis630_setup(dev)) {
+               dev_err(&dev->dev,
+                       "SIS630 compatible bus not detected, "
+@@ -522,7 +524,15 @@ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id)
+       snprintf(sis630_adapter.name, sizeof(sis630_adapter.name),
+                "SMBus SIS630 adapter at %04x", smbus_base + SMB_STS);
+-      return i2c_add_adapter(&sis630_adapter);
++      ret = i2c_add_adapter(&sis630_adapter);
++      if (ret)
++              goto release_region;
++
++      return 0;
++
++release_region:
++      release_region(smbus_base + SMB_STS, SIS630_SMB_IOREGION);
++      return ret;
+ }
+ static void sis630_remove(struct pci_dev *dev)
+-- 
+2.39.5
+
index bad087bcd11270e8f2de7e18013fa0feac516705..b8e5f3aaa0223881c6993c9b678a95259743790e 100644 (file)
@@ -45,3 +45,6 @@ drm-amd-display-assign-normalized_pix_clk-when-color-depth-14.patch
 qlcnic-fix-memory-leak-issues-in-qlcnic_sriov_common.c.patch
 drm-gma500-add-null-check-for-pci_gfx_root-in-mid_ge.patch
 asoc-codecs-wm0010-fix-error-handling-path-in-wm0010.patch
+i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch
+i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch
+i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch