From: Dan Streetman <ddstreet@ieee.org>
To: benh@kernel.crashing.org,
Seth Jennings <sjennings@variantweb.net>,
Robert Jennings <rcj4747@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, Dan Streetman <ddstreet@ieee.org>
Subject: [PATCH] drivers/crypto/nx: prevent oops on module exit
Date: Thu, 16 Oct 2014 15:30:19 -0400 [thread overview]
Message-ID: <1413487819-6119-1-git-send-email-ddstreet@ieee.org> (raw)
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
next reply other threads:[~2014-10-16 19:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 19:30 Dan Streetman [this message]
2014-10-16 22:43 ` [PATCH] drivers/crypto/nx: prevent oops on module exit 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413487819-6119-1-git-send-email-ddstreet@ieee.org \
--to=ddstreet@ieee.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rcj4747@gmail.com \
--cc=sjennings@variantweb.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox