From patchwork Thu Dec 20 19:11:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1900881 Return-Path: X-Original-To: patchwork-kvm@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 3F1C440076 for ; Thu, 20 Dec 2012 19:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017Ab2LTTM1 (ORCPT ); Thu, 20 Dec 2012 14:12:27 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:20655 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337Ab2LTTMY (ORCPT ); Thu, 20 Dec 2012 14:12:24 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBKJCIll007841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Dec 2012 19:12:19 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBKJCH6f024957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Dec 2012 19:12:18 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBKJCG29013039; Thu, 20 Dec 2012 13:12:16 -0600 Received: from lappy.us.oracle.com (/10.154.171.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 20 Dec 2012 11:12:15 -0800 From: Sasha Levin To: Pekka Enberg , Sasha Levin , Asias He , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sasha Levin Subject: [PATCH] kvm tools: remove unneeded checks in qcow code Date: Thu, 20 Dec 2012 14:11:10 -0500 Message-Id: <1356030701-16284-2-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1356030701-16284-1-git-send-email-sasha.levin@oracle.com> References: <1356030701-16284-1-git-send-email-sasha.levin@oracle.com> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We already know q!=NULL at that point, no need to retest. Signed-off-by: Sasha Levin Reviewed-by: Jesper Juhl --- tools/kvm/disk/qcow.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/kvm/disk/qcow.c b/tools/kvm/disk/qcow.c index ee2992e..64a2550 100644 --- a/tools/kvm/disk/qcow.c +++ b/tools/kvm/disk/qcow.c @@ -1361,8 +1361,7 @@ free_header: if (q->header) free(q->header); free_qcow: - if (q) - free(q); + free(q); return NULL; } @@ -1492,8 +1491,7 @@ free_header: if (q->header) free(q->header); free_qcow: - if (q) - free(q); + free(q); return NULL; }