Skip to content

Commit

Permalink
nfsd: remove some unneeded checks
Browse files Browse the repository at this point in the history
We check for zero length strings in the caller now, so these aren't
needed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Feb 3, 2012
1 parent 6d8d174 commit 3476964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
struct svc_expkey key;
struct svc_expkey *ek = NULL;

if (mlen < 1 || mesg[mlen-1] != '\n')
if (mesg[mlen - 1] != '\n')
return -EINVAL;
mesg[mlen-1] = 0;

Expand Down
2 changes: 1 addition & 1 deletion net/sunrpc/svcauth_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static int unix_gid_parse(struct cache_detail *cd,
time_t expiry;
struct unix_gid ug, *ugp;

if (mlen <= 0 || mesg[mlen-1] != '\n')
if (mesg[mlen - 1] != '\n')
return -EINVAL;
mesg[mlen-1] = 0;

Expand Down

0 comments on commit 3476964

Please sign in to comment.