diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-08-31 04:56:08 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-08-31 04:56:08 +0300 |
commit | e0f14b8ca3882988d15f0b1b853ae3c29d8c9a83 (patch) | |
tree | 126bf22ac19fbe7ef8b643b38adb440ff8d9be76 /drivers | |
parent | ab9bb6318b0967671e0c9b6537c1537d51ca4f45 (diff) | |
parent | 5871cd93692c8071fb9358daccb715b5081316ac (diff) | |
download | linux-e0f14b8ca3882988d15f0b1b853ae3c29d8c9a83.tar.xz |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu:
"Fix a potential crash in the ccp driver"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: ccp - Ignore unconfigured CCP device on suspend/resume
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/ccp/ccp-dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index f79eede71c62..edefa669153f 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c @@ -540,6 +540,10 @@ int ccp_dev_suspend(struct sp_device *sp, pm_message_t state) unsigned long flags; unsigned int i; + /* If there's no device there's nothing to do */ + if (!ccp) + return 0; + spin_lock_irqsave(&ccp->cmd_lock, flags); ccp->suspending = 1; @@ -564,6 +568,10 @@ int ccp_dev_resume(struct sp_device *sp) unsigned long flags; unsigned int i; + /* If there's no device there's nothing to do */ + if (!ccp) + return 0; + spin_lock_irqsave(&ccp->cmd_lock, flags); ccp->suspending = 0; |