From patchwork Sun Jan 20 21:04:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Czarcinski X-Patchwork-Id: 2008641 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 01F923FD86 for ; Sun, 20 Jan 2013 21:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577Ab3ATVFC (ORCPT ); Sun, 20 Jan 2013 16:05:02 -0500 Received: from eastrmfepo101.cox.net ([68.230.241.213]:55864 "EHLO eastrmfepo101.cox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527Ab3ATVEj (ORCPT ); Sun, 20 Jan 2013 16:04:39 -0500 Received: from eastrmimpo209 ([68.230.241.224]) by eastrmfepo101.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20130120210438.XEQF2891.eastrmfepo101.cox.net@eastrmimpo209> for ; Sun, 20 Jan 2013 16:04:38 -0500 Received: from falcon.lcl ([68.100.144.189]) by eastrmimpo209 with cox id qM4W1k00945PsQc01M4efz; Sun, 20 Jan 2013 16:04:38 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020209.50FC5BE6.0059,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=E5JPVNhl c=1 sm=1 a=xiXiwr23JuvKlkj6ngz4TA==:17 a=Q5Zkw0dSPrQA:10 a=103jMkqsgCkA:10 a=BIJj-m-0AAAA:8 a=fLW6IXNTFIgA:10 a=omOdbC7AAAAA:8 a=VniAs_VawHq-ImK0Fu8A:9 a=LUue1KWhiSUA:10 a=xiXiwr23JuvKlkj6ngz4TA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (CRAM-MD5) smtp.auth=gczarcinski@cox.net From: Gene Czarcinski To: linux-btrfs@vger.kernel.org Cc: Chen Yang , Gene Czarcinski Subject: [PATCH 04/13] Btrfs-progs: Fix a segmentation fault in btrfstune when is invalid. Date: Sun, 20 Jan 2013 16:04:09 -0500 Message-Id: <1358715858-4469-5-git-send-email-gene@czarc.net> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1358715858-4469-1-git-send-email-gene@czarc.net> References: <1358715858-4469-1-git-send-email-gene@czarc.net> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Chen Yang When open_ctree(device, ...) failed, the return value should be checked. Signed-off-by: Cheng Yang Signed-off-by: Gene Czarcinski --- btrfstune.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfstune.c b/btrfstune.c index 47830c5..07648d5 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -107,6 +107,8 @@ int main(int argc, char *argv[]) } root = open_ctree(device, 0, 1); + if (!root) + return 1; if (seeding_flag) { ret = update_seeding_flag(root, seeding_value);