Skip to contentSkip to conversation

n2_crypto: Fix a get/put_cpu() imbalance

PATCH In review Thomas Meyer 3 participants 5 messages Aug 6, 2011 – Aug 15, 2011 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 n2_crypto: Fix a get/put_cpu() imbalance

From: Thomas Meyer <[email protected]>

Fix a get/put_cpu() imbalance in the error case when qp == NULL

---

drivers/crypto/n2_core.c +2 -4
index d0183ddb..6683b58 100644
@@ -1006,9 +1006,8 @@ static int n2_do_ecb(struct ablkcipher_request *req, bool encrypt)
 
        spin_unlock_irqrestore(&qp->lock, flags);
 
-       put_cpu();
-
 out:
+       put_cpu();
        n2_chunk_complete(req, NULL);
        return err;
 }
@@ -1096,9 +1095,8 @@ static int n2_do_chaining(struct ablkcipher_request *req, bool encrypt)
 
        spin_unlock_irqrestore(&qp->lock, flags);
 
-       put_cpu();
-
 out:
+       put_cpu();
        n2_chunk_complete(req, err ? NULL : final_iv_addr);
        return err;
 }
#2 lore raw
In reply to Thomas Meyer
Quoted 5 lines · Thomas Meyer

From: Thomas Meyer <[email protected]>

Fix a get/put_cpu() imbalance in the error case when qp == NULL

I tried to apply your patch but it doesn't work as your mailer has turned all the tabs into spaces. Please resend and make sure that you can still apply the patch that the list forwards back to you.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#3 lore raw

From: Thomas Meyer <[email protected]>

Fix a get/put_cpu() imbalance in the error case when qp == NULL

---

Am Mittwoch, den 10.08.2011, 18:59 +0800 schrieb Herbert Xu:

Quoted 9 lines · Thomas Meyer
Quoted 5 lines

From: Thomas Meyer <[email protected]>

Fix a get/put_cpu() imbalance in the error case when qp == NULL

I tried to apply your patch but it doesn't work as your mailer has turned all the tabs into spaces.

Actually this was not my mailer's fault...

Quoted 6 lines

Please resend and make
sure that you can still apply the patch that the list forwards back to you.

Thanks,

drivers/crypto/n2_core.c +2 -2
index d0183ddb..8944dab 100644
@@ -1006,9 +1006,9 @@ static int n2_do_ecb(struct ablkcipher_request *req, bool encrypt)
 
 	spin_unlock_irqrestore(&qp->lock, flags);
 
+out:
 	put_cpu();
 
-out:
 	n2_chunk_complete(req, NULL);
 	return err;
 }
@@ -1096,9 +1096,9 @@ static int n2_do_chaining(struct ablkcipher_request *req, bool encrypt)
 
 	spin_unlock_irqrestore(&qp->lock, flags);
 
+out:
 	put_cpu();
 
-out:
 	n2_chunk_complete(req, err ? NULL : final_iv_addr);
 	return err;
 }