Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C59BFC43331 for ; Thu, 7 Nov 2019 21:30:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 935F521D7F for ; Thu, 7 Nov 2019 21:30:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="RWO7DixW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725882AbfKGVaz (ORCPT ); Thu, 7 Nov 2019 16:30:55 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:58000 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbfKGVay (ORCPT ); Thu, 7 Nov 2019 16:30:54 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA7LUX80017423; Thu, 7 Nov 2019 21:30:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2019-08-05; bh=k1wB1kfmToojyLeZrxP4P7Ko8cYYFJIiWVQUD6MS2n0=; b=RWO7DixWs4OBSTf/9xm7bHLbig53kw/FkYvBIvmflTwVKyTxbNFGtSRSrUU9mRWIxvNL /aW/B5UPtzwCZ3pLqsfaZakEolHnSz3tlOgdf73tDn79+agSjKQkRald4c/6qJJNYXOm h+FJDp/sYMS3YSQPW5BHP9kg8RxuVut3rQo0jnUNUbaFfL27sN27aVVSHEcw6CCoV38F 1LUzIXz/eZQaycamQO68cNqAZ/jO/HrFlZdQwtftYuB6MG9gED/CyVYSUTCGrx8o10g4 IEAoHDSPTpv3Vi3k+Q3iwBN5RlkFupvTHXL2tSi6v3OunqcD8w9irQ5l/4OpgrNKgGpA 0A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2w41w115tc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2019 21:30:49 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA7LE6tU036510; Thu, 7 Nov 2019 21:30:49 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2w41wfwusx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2019 21:30:48 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xA7LUmUO005047; Thu, 7 Nov 2019 21:30:48 GMT Received: from localhost (/10.145.179.16) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Nov 2019 13:30:48 -0800 Date: Thu, 7 Nov 2019 13:30:47 -0800 From: "Darrick J. Wong" To: Eric Sandeen Cc: xfs Subject: [PATCH] xfs_scrub: fix complaint about uninitialized ret Message-ID: <20191107213047.GG6219@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9434 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911070197 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9434 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911070198 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Coverity complained about the uninitialized ret in run_scrub_phases. It's not sophisticated enough to realize that phase 1 and 7 are both marked mustrun and are never the repair or datascan dummies and that therefore ret is always initialized by the end of the for loop, but OTOH there's no reason not to fix a trivial logic bomb if that ever changes. Coverity-id: 1455255 Signed-off-by: Darrick J. Wong --- scrub/xfs_scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index a792768c..014c54dd 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -422,7 +422,7 @@ run_scrub_phases( unsigned int debug_phase = 0; unsigned int phase; int rshift; - int ret; + int ret = 0; if (debug_tweak_on("XFS_SCRUB_PHASE")) debug_phase = atoi(getenv("XFS_SCRUB_PHASE"));