nfs: testing the wrong variable
Subsystems (3)
PATCH 1/1 nfs: testing the wrong variable
The intent was to test "*desc" for allocation failures, but it tests "desc" which is always a valid pointer here.
Signed-off-by Dan Carpenter <[email protected]>
fs/nfs/idmap.c +1 -1
@@ -123,7 +123,7 @@ static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen,size_t desclen = typelen + namelen +2 ; *desc =kmalloc (desclen,GFP_KERNEL ); -if (!desc) +if (!*desc)return -ENOMEM ; cp = *desc;
Trond Myklebust
AppliedQuoted 10 lines · Dan Carpenter
The intent was to test "*desc" for allocation failures, but it tests "desc" which is always a valid pointer here.
Signed-off-by Dan Carpenter <[email protected]>fs/nfs/idmap.c +0
-0
fs/nfs/idmap.c static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen, · line 129
Quoted 8 lines
fs/nfs/idmap.c +1
-1@@ -123,7 +123,7 @@ static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen,size_t desclen = typelen + namelen +2 ; *desc =kmalloc (desclen,GFP_KERNEL ); -if (!desc) +if (!*desc)return -ENOMEM ; cp = *desc;
Thanks! Applied!
Trond