From patchwork Sat Oct 17 07:55:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 36291 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 19F47B7043 for ; Sat, 17 Oct 2009 18:59:42 +1100 (EST) Received: from localhost ([127.0.0.1]:33838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mz4CR-0007C9-0V for incoming@patchwork.ozlabs.org; Sat, 17 Oct 2009 03:59:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mz48h-0005lA-5B for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mz48c-0005ip-CF for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:46 -0400 Received: from [199.232.76.173] (port=40192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mz48c-0005im-91 for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28872) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mz48b-0001xX-PW for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:42 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9H7terY032294 for ; Sat, 17 Oct 2009 03:55:41 -0400 Received: from localhost.localdomain (vpn1-5-47.ams2.redhat.com [10.36.5.47]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9H7taRf019772; Sat, 17 Oct 2009 03:55:39 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 17 Oct 2009 09:55:31 +0200 Message-Id: <1255766136-3028-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1255766136-3028-1-git-send-email-pbonzini@redhat.com> References: <1255766136-3028-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Luiz Capitulino Subject: [Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type 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 Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qobject.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qobject.h b/qobject.h index 4cc9287..200644d 100644 --- a/qobject.h +++ b/qobject.h @@ -102,6 +102,8 @@ static inline void qobject_decref(QObject *obj) */ static inline qtype_code qobject_type(const QObject *obj) { + if (!obj) + return QTYPE_NONE; assert(obj->type != NULL); return obj->type->code; }