Merge tag 'scsi-postmerge' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb...
[linux-2.6-block.git] / crypto / crypto_user.c
index 0dbe2be7f78316b2359f11be09ac24e528f3b8de..5c291eedaa7029427513521ace34aea2cf9e1ff7 100644 (file)
@@ -169,7 +169,7 @@ static int crypto_report_one(struct crypto_alg *alg,
        ualg->cru_type = 0;
        ualg->cru_mask = 0;
        ualg->cru_flags = alg->cra_flags;
-       ualg->cru_refcnt = atomic_read(&alg->cra_refcnt);
+       ualg->cru_refcnt = refcount_read(&alg->cra_refcnt);
 
        if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority))
                goto nla_put_failure;
@@ -387,7 +387,7 @@ static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
                goto drop_alg;
 
        err = -EBUSY;
-       if (atomic_read(&alg->cra_refcnt) > 2)
+       if (refcount_read(&alg->cra_refcnt) > 2)
                goto drop_alg;
 
        err = crypto_unregister_instance((struct crypto_instance *)alg);