Skip to content

Commit

Permalink
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Aug 31, 2019
2 parents ab9bb63 + 5871cd9 commit e0f14b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/crypto/ccp/ccp-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e0f14b8

Please sign in to comment.