[PATCH] drivers/crypto/nx: prevent oops on module exit

Subsystems: crypto api, ibm power 842 compression accelerator, linux for powerpc (32-bit and 64-bit), the rest

STALE4386d

6 messages, 4 authors, 2014-10-17 · open the first message on its own page

[PATCH] drivers/crypto/nx: prevent oops on module exit

From: Dan Streetman <hidden>
Date: 2014-10-16 19:30:46

Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.

Signed-off-by: Dan Streetman <redacted>
---

Also Seth and Rob, you guys should change your emails in this
driver, your IBM emails are still listed.

 drivers/crypto/nx/nx-842.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index 061407d..809a220 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -1269,7 +1269,7 @@ static void __exit nx842_exit(void)
 	RCU_INIT_POINTER(devdata, NULL);
 	spin_unlock_irqrestore(&devdata_mutex, flags);
 	synchronize_rcu();
-	if (old_devdata)
+	if (old_devdata && old_devdata->dev)
 		dev_set_drvdata(old_devdata->dev, NULL);
 	kfree(old_devdata);
 	vio_unregister_driver(&nx842_driver);
-- 
1.8.3.1

Re: [PATCH] drivers/crypto/nx: prevent oops on module exit

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2014-10-16 22:43:56

On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.
Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot [off-list ref] (supporter:IBM Power 842 com...)
Marcelo Henrique Cerri [off-list ref] (supporter:IBM Power in-Nest...)
Fionnuala Gunter [off-list ref] (supporter:IBM Power in-Nest...)
Herbert Xu [off-list ref] (maintainer:CRYPTO API)
"David S. Miller" [off-list ref] (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for MAINTAINERS.

cheers

Re: [PATCH] drivers/crypto/nx: prevent oops on module exit

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2014-10-16 22:52:44

On Fri, 2014-10-17 at 09:43 +1100, Michael Ellerman wrote:
On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
quoted
Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.
Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot [off-list ref] (supporter:IBM Power 842 com...)
Marcelo Henrique Cerri [off-list ref] (supporter:IBM Power in-Nest...)
Fionnuala Gunter [off-list ref] (supporter:IBM Power in-Nest...)
Herbert Xu [off-list ref] (maintainer:CRYPTO API)
"David S. Miller" [off-list ref] (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for MAINTAINERS.
I think Dan now owns that driver, Dan, please confirm.

Cheers,
Ben.

Re: [PATCH] drivers/crypto/nx: prevent oops on module exit

From: Seth Jennings <hidden>
Date: 2014-10-17 08:04:57

On Fri, 2014-10-17 at 09:43 +1100, Michael Ellerman wrote:
quoted
On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
quoted
Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.
Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an
ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot [off-list ref] (supporter:IBM Power 842
com...)
Marcelo Henrique Cerri [off-list ref] (supporter:IBM Power
in-Nest...)
Fionnuala Gunter [off-list ref] (supporter:IBM Power
in-Nest...)
Herbert Xu [off-list ref] (maintainer:CRYPTO API)
"David S. Miller" [off-list ref] (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for
MAINTAINERS.
I think Dan now owns that driver, Dan, please confirm.
I guess I'm not on the maintainer list anymore, as I shouldn't be
since I don't work at IBM anymore.

So... yeah.  I was the original co-author of driver so I acked it
but I'm not the maintainer anymore.  Which I shouldn't be, since
I don't work at IBM anymore.

Seth
Cheers,
Ben.

Re: [PATCH] drivers/crypto/nx: prevent oops on module exit

From: Seth Jennings <hidden>
Date: 2014-10-17 08:09:56

quoted
On Fri, 2014-10-17 at 09:43 +1100, Michael Ellerman wrote:
quoted
On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
quoted
Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.
Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an
ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot [off-list ref] (supporter:IBM Power 842
com...)
Marcelo Henrique Cerri [off-list ref] (supporter:IBM
Power
in-Nest...)
Fionnuala Gunter [off-list ref] (supporter:IBM Power
in-Nest...)
Herbert Xu [off-list ref] (maintainer:CRYPTO API)
"David S. Miller" [off-list ref] (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for
MAINTAINERS.
I think Dan now owns that driver, Dan, please confirm.
I guess I'm not on the maintainer list anymore, as I shouldn't be
since I don't work at IBM anymore.
Wow, I messed that up.  Repeating myself :-/  Sorry for the noise.

Seth
So... yeah.  I was the original co-author of driver so I acked it
but I'm not the maintainer anymore.  Which I shouldn't be, since
I don't work at IBM anymore.

Seth
quoted
Cheers,
Ben.

Re: [PATCH] drivers/crypto/nx: prevent oops on module exit

From: Dan Streetman <hidden>
Date: 2014-10-17 22:05:27

Yep, I own the driver now, I'll send a maintainers patch.


On Thu, Oct 16, 2014 at 6:52 PM, Benjamin Herrenschmidt
[off-list ref] wrote:
On Fri, 2014-10-17 at 09:43 +1100, Michael Ellerman wrote:
quoted
On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
quoted
Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.
Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot [off-list ref] (supporter:IBM Power 842 com...)
Marcelo Henrique Cerri [off-list ref] (supporter:IBM Power in-Nest...)
Fionnuala Gunter [off-list ref] (supporter:IBM Power in-Nest...)
Herbert Xu [off-list ref] (maintainer:CRYPTO API)
"David S. Miller" [off-list ref] (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for MAINTAINERS.
I think Dan now owns that driver, Dan, please confirm.

Cheers,
Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help