diff mbox

cxl: Test the correct mmio space before unmapping

Message ID 1435816521-13159-1-git-send-email-dja@axtens.net (mailing list archive)
State Accepted
Delegated to: Michael Ellerman
Headers show

Commit Message

Daniel Axtens July 2, 2015, 5:55 a.m. UTC
Before freeing p2n, test p2n, not p1n.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

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(-)

Comments

Ian Munsie July 2, 2015, 5:58 a.m. UTC | #1
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Michael Neuling July 3, 2015, 12:23 a.m. UTC | #2
On Thu, 2015-07-02 at 15:55 +1000, Daniel Axtens wrote:
> Before freeing p2n, test p2n, not p1n.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Nice catch but can you resend with a CC stable?

Mikey

> 
> ---
> 
> 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(-)
> 
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index a16988d..fd43462 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -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);
Michael Neuling July 3, 2015, 12:27 a.m. UTC | #3
On Fri, 2015-07-03 at 10:23 +1000, Michael Neuling wrote:
> On Thu, 2015-07-02 at 15:55 +1000, Daniel Axtens wrote:
> > Before freeing p2n, test p2n, not p1n.
> > 
> > Signed-off-by: Daniel Axtens <dja@axtens.net>
> 
> 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

> 
> Mikey
> 
> > 
> > ---
> > 
> > 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(-)
> > 
> > diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> > index a16988d..fd43462 100644
> > --- a/drivers/misc/cxl/pci.c
> > +++ b/drivers/misc/cxl/pci.c
> > @@ -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);
>
Michael Ellerman July 7, 2015, 10:38 a.m. UTC | #4
On Thu, 2015-02-07 at 05:55:21 UTC, Daniel Axtens wrote:
> Before freeing p2n, test p2n, not p1n.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?h=fixes&id=8c00d5c9d3e7452658dda55024485d52919ebfdd

cheers
diff mbox

Patch

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index a16988d..fd43462 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -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);