drm: fix some lindent damage
[safe/jmp/linux-2.6] / crypto / api.c
index 2d8d828..959c4e5 100644 (file)
@@ -13,6 +13,8 @@
  * any later version.
  *
  */
+
+#include <linux/compiler.h>
 #include <linux/init.h>
 #include <linux/crypto.h>
 #include <linux/errno.h>
@@ -64,7 +66,8 @@ static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name)
 
 static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags)
 {
-       tfm->crt_flags = 0;
+       tfm->crt_flags = flags & CRYPTO_TFM_REQ_MASK;
+       flags &= ~CRYPTO_TFM_REQ_MASK;
        
        switch (crypto_tfm_alg_type(tfm)) {
        case CRYPTO_ALG_TYPE_CIPHER:
@@ -189,8 +192,14 @@ out:
 
 void crypto_free_tfm(struct crypto_tfm *tfm)
 {
-       struct crypto_alg *alg = tfm->__crt_alg;
-       int size = sizeof(*tfm) + alg->cra_ctxsize;
+       struct crypto_alg *alg;
+       int size;
+
+       if (unlikely(!tfm))
+               return;
+
+       alg = tfm->__crt_alg;
+       size = sizeof(*tfm) + alg->cra_ctxsize;
 
        crypto_exit_ops(tfm);
        crypto_alg_put(alg);