From patchwork Tue Mar 26 02:00:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alakesh Haloi X-Patchwork-Id: 10870383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CB44922 for ; Tue, 26 Mar 2019 02:00:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 230DF28CE7 for ; Tue, 26 Mar 2019 02:00:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 116C5290EC; Tue, 26 Mar 2019 02:00:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0246628CE7 for ; Tue, 26 Mar 2019 02:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730804AbfCZCAF (ORCPT ); Mon, 25 Mar 2019 22:00:05 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36093 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbfCZCAF (ORCPT ); Mon, 25 Mar 2019 22:00:05 -0400 Received: by mail-pg1-f194.google.com with SMTP id r124so7479198pgr.3; Mon, 25 Mar 2019 19:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=t+qMmHzBR4DjmBcN69RFLD3h2J4om3ztagHlBsYe6Kk=; b=DHSWLj0OnWP2FrggkOf4UJYd9aUo8fBQlQvAJiuM6p4Yq1fEjursjHf0pf1lJBlEBX Zg8OOxe4RDOhIBEfGh4xzoOLczntBv3doDbLKtEDO/1h3GV5B4GQQrnTYmtAIYJdtjzV 7Q4Hpq5xC7jRvc+6reNZv+Co3hgLAhldr6gsCyqye1a+wHeJVpKXRpgwNmue9mW32eTD FYVBdzeZ+5ffCgKnYYJv04Oq4q/sOlv9BOSG+I+iyD1YLSwTtGiS48YhG0Z7td6FYne5 C1uX4wa+iWZAiyq4lofI/ULcqQNp3yN4ElgTEakcCIcPkXj7fwE6LaNiMwiKOdzdG4ct pogw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=t+qMmHzBR4DjmBcN69RFLD3h2J4om3ztagHlBsYe6Kk=; b=onS+0zdU5kCsj66gzLLXgDR0RQOB4FkpciOlVaYV62gHnzDlUUw6NVezYA+Qne52x3 2+BVWqZKVbCS8/9QMRK+zOqxof50rgZ+urJv9LAvItOhcUvdZJ7THgfhGQjBQDab9zW9 4EUglJLTXYhJAJ5yeQid5Bnjk4T6WZ/Zic45qU43ewGECDIs86Gbb7276Y1hJsN125+l 50+K5NYGkmmW5B6jR7krYwLO2eHB6W04i9+h/QsmEyXnPJhq4FKKmaRzN8TrFts03G5p shZNUuAHyiRG9spoOIkY8oTQqbduRM8jFiEBnkWwhLw/oCWye0qFRmaKPffa0vBDecEv FUvA== X-Gm-Message-State: APjAAAXSf4D/wZQAI9ne7yWLBciA9Tj0cDpDIfYQmL1k2H9h3hF4oXCR NytmV5kghNSWLGYHuf0X5R0= X-Google-Smtp-Source: APXvYqzn/Z+QH+uMwh1Kyw6P9zMcleSTncNNiLb9W4VtYNvZncgytQ8YZUOze6Ue3MndQY7GWQ1ikg== X-Received: by 2002:a65:6299:: with SMTP id f25mr26843229pgv.376.1553565604263; Mon, 25 Mar 2019 19:00:04 -0700 (PDT) Received: from ip-172-31-25-235.us-west-2.compute.internal (ec2-54-245-141-36.us-west-2.compute.amazonaws.com. [54.245.141.36]) by smtp.gmail.com with ESMTPSA id 17sm23841230pgt.0.2019.03.25.19.00.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 19:00:03 -0700 (PDT) Date: Tue, 26 Mar 2019 02:00:01 +0000 From: Alakesh Haloi To: Trond Myklebust , Anna Schumaker , "J. Bruce Fields" , Jeff Layton , "David S. Miller" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, trivial@kernel.org Subject: [PATCH] SUNRPC: fix uninitialized variable warning Message-ID: <20190326020001.GA29659@ip-172-31-25-235.us-west-2.compute.internal> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid following compiler warning on uninitialized variable net/sunrpc/xprtsock.c: In function ‘xs_read_stream_request.constprop’: net/sunrpc/xprtsock.c:525:10: warning: ‘read’ may be used uninitialized in this function [-Wmaybe-uninitialized] return read; ^~~~ net/sunrpc/xprtsock.c:529:23: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? ret : read; ~~~~~~~~~~~~~~^~~~~~ Signed-off-by: Alakesh Haloi --- net/sunrpc/xprtsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 9359539907ba..732d4b57411a 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -495,8 +495,8 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg, int flags, struct rpc_rqst *req) { struct xdr_buf *buf = &req->rq_private_buf; - size_t want, read; - ssize_t ret; + size_t want, uninitialized_var(read); + ssize_t uninitialized_var(ret); xs_read_header(transport, buf);