From patchwork Mon Jan 24 21:10:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 80268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AA93CB7113 for ; Tue, 25 Jan 2011 08:37:33 +1100 (EST) Received: from localhost ([127.0.0.1]:52355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhU6M-0004r4-Rg for incoming@patchwork.ozlabs.org; Mon, 24 Jan 2011 16:37:31 -0500 Received: from [140.186.70.92] (port=60757 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTfl-00016P-N6 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:10:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTfj-0007Rx-C1 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:10:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTfj-0007Rm-14 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:59 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0OL9uUR003378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Jan 2011 16:09:56 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-5-230.ams2.redhat.com [10.36.5.230]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0OL9I79003712; Mon, 24 Jan 2011 16:09:54 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 24 Jan 2011 22:10:41 +0100 Message-Id: <1295903452-18017-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1295903452-18017-1-git-send-email-kwolf@redhat.com> References: <1295903452-18017-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 12/23] ide: Remove unneeded null pointer check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Stefan Weil With bm == NULL, other code in the same function would crash. This bug was reported by cppcheck: hw/ide/pci.c:280: error: Possible null pointer dereference: bm Cc: Michael S. Tsirkin Signed-off-by: Stefan Weil Signed-off-by: Kevin Wolf --- hw/ide/pci.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 987caff..35168cb 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -267,9 +267,7 @@ static void bmdma_irq(void *opaque, int n, int level) return; } - if (bm) { - bm->status |= BM_STATUS_INT; - } + bm->status |= BM_STATUS_INT; /* trigger the real irq */ qemu_set_irq(bm->irq, level);