From patchwork Thu Feb 7 15:29:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2111331 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C0A68DFB7B for ; Thu, 7 Feb 2013 15:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755653Ab3BGP3N (ORCPT ); Thu, 7 Feb 2013 10:29:13 -0500 Received: from mail-ye0-f178.google.com ([209.85.213.178]:51383 "EHLO mail-ye0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560Ab3BGP3M (ORCPT ); Thu, 7 Feb 2013 10:29:12 -0500 Received: by mail-ye0-f178.google.com with SMTP id j12so31577yeg.23 for ; Thu, 07 Feb 2013 07:29:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=lXOuj+eI1q/f1foXU1z63gAcYJ7wfPSrzfVv4ghda6I=; b=BhbxzL5fjqhTt0g8/d1pgfAOE11BzuduYzMAZArOvBhhzvejAJS/iQL+eWoFZXJx7k p8g7ICm/uLbwdY7W4rYvwDAokRM32E8q+cDpz3vgjDoxqgTgy/z90IQQrypvVV3K+6Dx nMlpyonO3MWakOzdaAnuVfyjetrsmlRjVCv0SEOIx9Aqd1XagJHHzqWKL/EYnwpAFoxx SZH4t0VyUIQBT1nuhU39MMunLfe5WHQnIeF/KA+0nRjpeFvVw429syldzxjBE234aNkl ez9yVYgVZYFq/OxOpMEVzXoE/UOQpCRgqw4rULojXQrgYhdX7s9cePCQcZpdI5lKSyNQ 6A4g== X-Received: by 10.236.141.144 with SMTP id g16mr89218yhj.118.1360250952221; Thu, 07 Feb 2013 07:29:12 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id d19sm25570740anm.18.2013.02.07.07.29.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Feb 2013 07:29:11 -0800 (PST) From: Jeff Layton To: trond.myklebust@netapp.com Cc: andros@netapp.com, linux-nfs@vger.kernel.org Subject: [PATCH] sunrpc: silence build warning in gss_fill_context Date: Thu, 7 Feb 2013 10:29:06 -0500 Message-Id: <1360250946-26745-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnZ+ta8mV0gl0rZ4tAsVBh6hg6AZd8NWzx6AvVvmBBmS4qrLDILHg39PlTCt02OPna9Q8S9 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Since commit 620038f6d23, gcc is throwing the following warning: CC [M] net/sunrpc/auth_gss/auth_gss.o In file included from include/linux/sunrpc/types.h:14:0, from include/linux/sunrpc/sched.h:14, from include/linux/sunrpc/clnt.h:18, from net/sunrpc/auth_gss/auth_gss.c:45: net/sunrpc/auth_gss/auth_gss.c: In function ‘gss_pipe_downcall’: include/linux/sunrpc/debug.h:45:10: warning: ‘timeout’ may be used uninitialized in this function [-Wmaybe-uninitialized] printk(KERN_DEFAULT args); \ ^ net/sunrpc/auth_gss/auth_gss.c:194:15: note: ‘timeout’ was declared here unsigned int timeout; ^ If simple_get_bytes returns an error, then we'll end up calling printk with an uninitialized timeout value. Reasonably harmless, but fairly simple to fix by setting the timeout to 0 if it does. Cc: Andy Adamson Signed-off-by: Jeff Layton --- net/sunrpc/auth_gss/auth_gss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 6e5c824..b706b4c 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -201,8 +201,10 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct * the -t value passed to GSSD. */ p = simple_get_bytes(p, end, &timeout, sizeof(timeout)); - if (IS_ERR(p)) + if (IS_ERR(p)) { + timeout = 0; goto err; + } if (timeout == 0) timeout = GSSD_MIN_TIMEOUT; ctx->gc_expiry = now + ((unsigned long)timeout * HZ);