You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] kfree cleanup: fs
This is the fs/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in fs/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
6044ec8882
commit
f99d49adf5
+2
-4
@@ -190,8 +190,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
|
||||
out:
|
||||
if (dom)
|
||||
auth_domain_put(dom);
|
||||
if (buf)
|
||||
kfree(buf);
|
||||
kfree(buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -428,8 +427,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
|
||||
path_release(&nd);
|
||||
if (dom)
|
||||
auth_domain_put(dom);
|
||||
if (buf)
|
||||
kfree(buf);
|
||||
kfree(buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
+3
-6
@@ -151,8 +151,7 @@ static u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
|
||||
if (nbytes <= sizeof(argp->tmp))
|
||||
p = argp->tmp;
|
||||
else {
|
||||
if (argp->tmpp)
|
||||
kfree(argp->tmpp);
|
||||
kfree(argp->tmpp);
|
||||
p = argp->tmpp = kmalloc(nbytes, GFP_KERNEL);
|
||||
if (!p)
|
||||
return NULL;
|
||||
@@ -2476,10 +2475,8 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args)
|
||||
kfree(args->ops);
|
||||
args->ops = args->iops;
|
||||
}
|
||||
if (args->tmpp) {
|
||||
kfree(args->tmpp);
|
||||
args->tmpp = NULL;
|
||||
}
|
||||
kfree(args->tmpp);
|
||||
args->tmpp = NULL;
|
||||
while (args->to_free) {
|
||||
struct tmpbuf *tb = args->to_free;
|
||||
args->to_free = tb->next;
|
||||
|
||||
+1
-2
@@ -93,8 +93,7 @@ nfsd_cache_shutdown(void)
|
||||
|
||||
cache_disabled = 1;
|
||||
|
||||
if (hash_list)
|
||||
kfree (hash_list);
|
||||
kfree (hash_list);
|
||||
hash_list = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user