Skip to content

Commit e0f14b8

Browse files
committed
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
2 parents ab9bb63 + 5871cd9 commit e0f14b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/crypto/ccp/ccp-dev.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ int ccp_dev_suspend(struct sp_device *sp, pm_message_t state)
540540
unsigned long flags;
541541
unsigned int i;
542542

543+
/* If there's no device there's nothing to do */
544+
if (!ccp)
545+
return 0;
546+
543547
spin_lock_irqsave(&ccp->cmd_lock, flags);
544548

545549
ccp->suspending = 1;
@@ -564,6 +568,10 @@ int ccp_dev_resume(struct sp_device *sp)
564568
unsigned long flags;
565569
unsigned int i;
566570

571+
/* If there's no device there's nothing to do */
572+
if (!ccp)
573+
return 0;
574+
567575
spin_lock_irqsave(&ccp->cmd_lock, flags);
568576

569577
ccp->suspending = 0;

0 commit comments

Comments
 (0)