From patchwork Tue Mar 22 11:38:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 8641341 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 644209F3D1 for ; Tue, 22 Mar 2016 11:39:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 884642025B for ; Tue, 22 Mar 2016 11:39:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96CE320225 for ; Tue, 22 Mar 2016 11:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759056AbcCVLjU (ORCPT ); Tue, 22 Mar 2016 07:39:20 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17642 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758758AbcCVLjU (ORCPT ); Tue, 22 Mar 2016 07:39:20 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2MBcwYg020044 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Mar 2016 11:38:58 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u2MBcvUi002504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 22 Mar 2016 11:38:57 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u2MBcvA5003221; Tue, 22 Mar 2016 11:38:57 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Mar 2016 04:38:56 -0700 Date: Tue, 22 Mar 2016 14:38:49 +0300 From: Dan Carpenter To: Alexander Viro , Dan Williams Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] dax: silence an uninitialized variable warning Message-ID: <20160322113848.GA4519@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I'm not positive, but it looks like it might be possible to reach the end of this function and return an uninitialized value for "rc". Anyway it causes a static checker warning and let's silence it. The warning was introduced in commit b2e0d1625e19 ('dax: fix lifetime of in-kernel dax mappings with dax_map_atomic()'). Signed-off-by: Dan Carpenter Reviewed-by: Jeff Moyer --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/dax.c b/fs/dax.c index 90322eb..3744e14 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -155,7 +155,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, loff_t pos = start, max = start, bh_max = start; bool hole = false, need_wmb = false; struct block_device *bdev = NULL; - int rw = iov_iter_rw(iter), rc; + int rc = 0; + int rw = iov_iter_rw(iter); long map_len = 0; struct blk_dax_ctl dax = { .addr = (void __pmem *) ERR_PTR(-EIO),