Skip to contentSkip to conversation

cxl: Test the correct mmio space before unmapping

PATCH Applied Daniel Axtens 5 participants 5 messages Jul 2, 2015 – Jul 7, 2015 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl: Test the correct mmio space before unmapping

Before freeing p2n, test p2n, not p1n.

---

While a potentially nasty bug, this is only hit (at the moment) in cxl_remove, so it's probably not a candidate for stable.

---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/cxl/pci.c +1 -1
index a16988d..fd43462 100644
@@ -540,7 +540,7 @@ err:
 
 static void cxl_unmap_slice_regs(struct cxl_afu *afu)
 {
-	if (afu->p1n_mmio)
+	if (afu->p2n_mmio)
 		iounmap(afu->p2n_mmio);
 	if (afu->p1n_mmio)
 		iounmap(afu->p1n_mmio);
Signature · 1 line
2.1.4
#2 lore raw
In reply to Daniel Axtens
Quoted 3 lines · Daniel Axtens

Before freeing p2n, test p2n, not p1n.
=20

Nice catch but can you resend with a CC stable?

Mikey

Quoted 22 lines

=20
---
=20
While a potentially nasty bug, this is only hit (at the moment) in cxl_remove, so it's probably not a candidate for stable.

---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

=20

drivers/misc/cxl/pci.c +0 -0
index a16988d..fd43462 100644
@@ -540,7 +540,7 @@ err:

=20
static void cxl_unmap_slice_regs(struct cxl_afu *afu) {

drivers/misc/cxl/pci.c +1 -1
-	if (afu->p1n_mmio)
+	if (afu->p2n_mmio)
 		iounmap(afu->p2n_mmio);
 	if (afu->p1n_mmio)
 		iounmap(afu->p1n_mmio);
#3 lore raw
Quoted 6 lines · Michael Neuling
Quoted 3 lines · Daniel Axtens

Before freeing p2n, test p2n, not p1n.
=20

=20
Nice catch but can you resend with a CC stable?

Actually stable is overkill, but this is a bug should to go in 4.2 as a bug fix.

Mikey

Quoted 26 lines

=20
Mikey
=20

Quoted 17 lines

=20
---
=20
While a potentially nasty bug, this is only hit (at the moment) in cxl_remove, so it's probably not a candidate for stable.

---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

=20

drivers/misc/cxl/pci.c +0 -0
index a16988d..fd43462 100644
@@ -540,7 +540,7 @@ err:

=20
static void cxl_unmap_slice_regs(struct cxl_afu *afu) {

drivers/misc/cxl/pci.c err: · line 546

Quoted 5 lines
drivers/misc/cxl/pci.c +1 -1
-	if (afu->p1n_mmio)
+	if (afu->p2n_mmio)
 		iounmap(afu->p2n_mmio);
 	if (afu->p1n_mmio)
 		iounmap(afu->p1n_mmio);

=20