public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH] drivers/crypto/nx: prevent oops on module exit
@ 2014-10-16 19:30 Dan Streetman
  2014-10-16 22:43 ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Streetman @ 2014-10-16 19:30 UTC (permalink / raw)
  To: benh, Seth Jennings, Robert Jennings; +Cc: linuxppc-dev, Dan Streetman

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 <ddstreet@ieee•org>
---

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-17 22:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 19:30 [PATCH] drivers/crypto/nx: prevent oops on module exit Dan Streetman
2014-10-16 22:43 ` Michael Ellerman
2014-10-16 22:52   ` Benjamin Herrenschmidt
2014-10-17  7:59     ` Seth Jennings
2014-10-17  8:02       ` Seth Jennings
2014-10-17 22:05     ` Dan Streetman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox