From patchwork Tue Jul 3 00:25:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Landden X-Patchwork-Id: 1148491 Return-Path: X-Original-To: patchwork-linux-btrfs@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 4BDBCDF22A for ; Tue, 3 Jul 2012 00:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755972Ab2GCAZa (ORCPT ); Mon, 2 Jul 2012 20:25:30 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:57072 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236Ab2GCAZ3 (ORCPT ); Mon, 2 Jul 2012 20:25:29 -0400 Received: by pbbrp8 with SMTP id rp8so8277877pbb.19 for ; Mon, 02 Jul 2012 17:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=7yDNGo49h+bZ4/LONRtQe12fkNwVM4vgc9zthoNAojI=; b=VYMasV2GSni8nD7+HEDL3T9OCA2IJeCx/XmK/qcFHPJx4o/JlrAMppQzIqf+Ut8pac puHn+t/sDQhtt5fFy58fYHei22ITwPi3+ZmLJfiD5K4J+nx2q5voD7bv3KHYSTvwEvm0 2qdiADtxBFyaHiy0OaEH3a14jeT+7F/3tnw1v4wWYWg2aYopCDlG5ReuSYfhZsUZ9EDX 6KmJUXPYTGWe+lUiSoj1tT8+uPbIN5nQjMyxzPIHn1qTiG2R/tfF+dVM4TziJlJWjHrA xS/WM51TAu0wEIlxHSrRp3XwdusmYFUmnTKM1JeCmk1DPdnZ9zk/OY542E1cu8tkAwwT 5NRQ== Received: by 10.68.211.194 with SMTP id ne2mr2501705pbc.14.1341275129085; Mon, 02 Jul 2012 17:25:29 -0700 (PDT) Received: from shawn-ssd.domain_not_set.invalid (ppp-71-139-6-111.dsl.snfc21.pacbell.net. [71.139.6.111]) by mx.google.com with ESMTPS id of4sm14138254pbb.51.2012.07.02.17.25.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Jul 2012 17:25:28 -0700 (PDT) From: Shawn Landden To: linux-btrfs@vger.kernel.org Cc: Shawn Landden Subject: [PATCH] Check for failure in open_ctree() call. (LP: #926186) Date: Mon, 2 Jul 2012 17:25:26 -0700 Message-Id: <1341275126-17671-1-git-send-email-shawnlandden@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org --- btrfstune.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/btrfstune.c b/btrfstune.c index 47830c5..f746e14 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -107,6 +107,10 @@ int main(int argc, char *argv[]) } root = open_ctree(device, 0, 1); + if (!root) { + fprintf(stderr, "unable to open ctree\n"); + return 1; + } if (seeding_flag) { ret = update_seeding_flag(root, seeding_value);