diff mbox

NFS: Give "flavor" an initial value to fix a compile warning

Message ID 1380142968-9515-1-git-send-email-bjschuma@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bryan Schumaker Sept. 25, 2013, 9:02 p.m. UTC
From: Anna Schumaker <bjschuma@netapp.com>

cd3c993 introduces a compile warning by not assigning an initial value
to the "flavor" variable.  This could only be a problem if the server
returns a supported secflavor list of length zero, but it's better to
fix this before it's ever hit.

Signed-off-by: Anna Schumaker <bjschuma@netapp.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Adamson, Dros Sept. 25, 2013, 9:16 p.m. UTC | #1
On Sep 25, 2013, at 5:02 PM, bjschuma@netapp.com wrote:

> From: Anna Schumaker <bjschuma@netapp.com>
> 
> cd3c993 introduces a compile warning by not assigning an initial value
> to the "flavor" variable.  This could only be a problem if the server
> returns a supported secflavor list of length zero, but it's better to
> fix this before it's ever hit.
> 
> Signed-off-by: Anna Schumaker <bjschuma@netapp.com>

Acked-by: Weston Andros Adamson <dros@netapp.com>

Thanks!
-dros

> ---
> fs/nfs/nfs4proc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index f5fe16b..d53d678 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -7576,7 +7576,7 @@ nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
> {
> 	int err;
> 	struct page *page;
> -	rpc_authflavor_t flavor;
> +	rpc_authflavor_t flavor = RPC_AUTH_MAXFLAVOR;
> 	struct nfs4_secinfo_flavors *flavors;
> 	struct nfs4_secinfo4 *secinfo;
> 	int i;
> -- 
> 1.8.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f5fe16b..d53d678 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7576,7 +7576,7 @@  nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
 {
 	int err;
 	struct page *page;
-	rpc_authflavor_t flavor;
+	rpc_authflavor_t flavor = RPC_AUTH_MAXFLAVOR;
 	struct nfs4_secinfo_flavors *flavors;
 	struct nfs4_secinfo4 *secinfo;
 	int i;