ecryptfs: don't allow mmap when the lower fs doesn't support it
[pandora-kernel.git] / fs / lockd / svcshare.c
index 6220dc2..b0ae070 100644 (file)
@@ -39,7 +39,7 @@ nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file,
                        return nlm_lck_denied;
        }
 
-       share = (struct nlm_share *) kmalloc(sizeof(*share) + oh->len,
+       share = kmalloc(sizeof(*share) + oh->len,
                                                GFP_KERNEL);
        if (share == NULL)
                return nlm_lck_denied_nolocks;
@@ -71,7 +71,8 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
        struct nlm_share        *share, **shpp;
        struct xdr_netobj       *oh = &argp->lock.oh;
 
-       for (shpp = &file->f_shares; (share = *shpp) != 0; shpp = &share->s_next) {
+       for (shpp = &file->f_shares; (share = *shpp) != NULL;
+                                       shpp = &share->s_next) {
                if (share->s_host == host && nlm_cmp_owner(share, oh)) {
                        *shpp = share->s_next;
                        kfree(share);