From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQiul-0003wX-1a for qemu-devel@nongnu.org; Sat, 15 Aug 2015 17:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQiuk-0000dU-AC for qemu-devel@nongnu.org; Sat, 15 Aug 2015 17:22:54 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:37434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQiuk-0000cB-3k for qemu-devel@nongnu.org; Sat, 15 Aug 2015 17:22:54 -0400 Received: by wibhh20 with SMTP id hh20so49987297wib.0 for ; Sat, 15 Aug 2015 14:22:53 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <76f0a328e53daa4a2303fe17d3bbe157d7b40d03.1437699224.git.alistair.francis@xilinx.com> References: <76f0a328e53daa4a2303fe17d3bbe157d7b40d03.1437699224.git.alistair.francis@xilinx.com> Date: Sat, 15 Aug 2015 14:22:53 -0700 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v1 2/3] object.c: object_class_dynamic_cast return NULL if the class has no type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis Cc: Sai Pavan Boddu , Peter Maydell , Edgar Iglesias , "qemu-devel@nongnu.org Developers" , =?UTF-8?Q?Andreas_F=C3=A4rber?= On Mon, Jul 27, 2015 at 11:37 AM, Alistair Francis wrote: > If the ObjectClass has no type return NULL instead of trying to compare > the type name. > What was the issue? Regards, Peter > Signed-off-by: Alistair Francis > Reviewed-by: Sai Pavan Boddu > --- > qom/object.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qom/object.c b/qom/object.c > index eea8edf..2d6d715 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -603,7 +603,7 @@ ObjectClass *object_class_dynamic_cast(ObjectClass *class, > TypeImpl *target_type; > TypeImpl *type; > > - if (!class) { > + if (!class || !class->type) { > return NULL; > } > > -- > 1.7.1 > >