lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] nfsd: remove some unneeded checks
On Fri, Jan 20, 2012 at 10:48:18AM +0300, Dan Carpenter wrote:
> We check for zero length strings in the caller now, so these aren't
> needed.

Thanks! Applying.--b.

>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index cf8a6bd..8e9689a 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -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;
>
> diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
> index 01153ea..6ab3573 100644
> --- a/net/sunrpc/svcauth_unix.c
> +++ b/net/sunrpc/svcauth_unix.c
> @@ -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;
>




\
 
 \ /
  Last update: 2012-01-20 19:37    [W:0.058 / U:1.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site