From patchwork Tue Jun 3 11:29:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Hesse X-Patchwork-Id: 4286731 X-Patchwork-Delegate: dave@jikos.cz Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 023B7BEEA7 for ; Tue, 3 Jun 2014 11:29:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2519B2021B for ; Tue, 3 Jun 2014 11:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AE69202A7 for ; Tue, 3 Jun 2014 11:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbaFCL3e (ORCPT ); Tue, 3 Jun 2014 07:29:34 -0400 Received: from mx.mylinuxtime.de ([148.251.109.235]:33789 "EHLO mx.mylinuxtime.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbaFCL3d (ORCPT ); Tue, 3 Jun 2014 07:29:33 -0400 Received: from leda.eworm.de (unknown [10.10.1.2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.mylinuxtime.de (Postfix) with ESMTPSA id 6B18A22678A; Tue, 3 Jun 2014 13:29:31 +0200 (CEST) Received: by leda.eworm.de (Postfix, from userid 1000) id 7F3561466F4; Tue, 3 Jun 2014 13:29:30 +0200 (CEST) From: Christian Hesse To: linux-btrfs@vger.kernel.org Cc: Christian Hesse Subject: [PATCH 1/1] btrfs-progs: fix compiler warning Date: Tue, 3 Jun 2014 13:29:19 +0200 Message-Id: <1401794959-25907-1-git-send-email-mail@eworm.de> X-Mailer: git-send-email 2.0.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 gcc 4.9.0 gives a warning: array subscript is above array bounds Checking for "greater or equal" instead of just "equal" fixes this. Signed-off-by: Christian Hesse --- cmds-restore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index 96b97e1..534a49e 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -169,7 +169,7 @@ again: break; } - if (level == BTRFS_MAX_LEVEL) + if (level >= BTRFS_MAX_LEVEL) return 1; slot = path->slots[level] + 1;