From 00f2692d10e0254366471095516d657693aeff42 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Agarwal Date: Tue, 7 Oct 2014 15:06:08 +0530 Subject: [PATCH] [Patch, microblaze]: Added cleanup data for invalid target description. Cleanup the tdesc data if the target description check is invalid. 2014-10-07 Ajit Agarwal * microblaze-tdep.c (microblaze_gdbarch_init): Use of tdesc_data_cleanup. Signed-off-by:Ajit Agarwal ajitkum@xilinx.com --- gdb/microblaze-tdep.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 6a9f11f..f257b96 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -722,7 +722,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) MICROBLAZE_SHR_REGNUM, "rshr"); } - } + + if (!valid_p) + { + tdesc_data_cleanup (tdesc_data); + return NULL; + } + } /* Allocate space for the new architecture. */ tdep = XNEW (struct gdbarch_tdep); -- 1.7.1