Skip to content

Commit 8f0d97b

Browse files
error27Trond Myklebust
authored andcommitted
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]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 015f021 commit 8f0d97b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/idmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen,
123123
size_t desclen = typelen + namelen + 2;
124124

125125
*desc = kmalloc(desclen, GFP_KERNEL);
126-
if (!desc)
126+
if (!*desc)
127127
return -ENOMEM;
128128

129129
cp = *desc;

0 commit comments

Comments
 (0)