Skip to content

Commit e25fbe3

Browse files
xiwTrond Myklebust
authored and
Trond Myklebust
committed
nfs: fix null checking in nfs_get_option_str()
The following null pointer check is broken. *option = match_strdup(args); return !option; The pointer `option' must be non-null, and thus `!option' is always false. Use `!*option' instead. The bug was introduced in commit c5cb09b ("Cleanup: Factor out some cut-and-paste code."). Signed-off-by: Xi Wang <xi.wang@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 39e88fc commit e25fbe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/super.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ static int nfs_get_option_str(substring_t args[], char **option)
11521152
{
11531153
kfree(*option);
11541154
*option = match_strdup(args);
1155-
return !option;
1155+
return !*option;
11561156
}
11571157

11581158
static int nfs_get_option_ul(substring_t args[], unsigned long *option)

0 commit comments

Comments
 (0)