Gabriel, Thanks. I fixed up a couple of memory leaks and also added a message to be printed in the ncurses interface if all devices are up to date. Can you take a look and give this a quick sniff test?
Thanks! Brian 8< Fix a memory leak in update-all-ucodes. Print a status summary to the user if, when chosing to update all devices to the latest microcode level using the ncurses interface, all devices are update which says "All devices up to date" Signed-off-by: Brian King <brk...@linux.vnet.ibm.com> --- iprconfig.c | 24 +++++++++++++++++------- iprconfig.h | 2 ++ 2 files changed, 19 insertions(+), 7 deletions(-) diff -puN iprconfig.c~iprutils_update_all_ucodes_fixes iprconfig.c --- iprutils.patch/iprconfig.c~iprutils_update_all_ucodes_fixes 2015-09-16 15:51:55.413526784 -0500 +++ iprutils.patch-bjking1/iprconfig.c 2015-09-16 16:23:16.847135630 -0500 @@ -11549,6 +11549,7 @@ int download_all_ucode(i_container *i_co int header_lines; char line[BUFSIZ]; char *body; + int rc = 93; processing(); i_con = free_i_con(i_con); @@ -11564,11 +11565,15 @@ int download_all_ucode(i_container *i_co continue; lfw = get_latest_fw_image(dev); - if (!lfw || lfw->version <= get_fw_version(dev)) + if (!lfw || lfw->version <= get_fw_version(dev)) { + free(lfw); continue; + } - if (ioa->is_secondary) + if (ioa->is_secondary) { + free(lfw); continue; + } sprintf(line, "%-6s %-10X %-10s %s\n", basename(dev->gen_name), lfw->version, @@ -11585,22 +11590,27 @@ int download_all_ucode(i_container *i_co } } - n_confirm_download_all_ucode.body = body; - s_out = screen_driver(&n_confirm_download_all_ucode, header_lines, i_con); + if (update_list) { + n_confirm_download_all_ucode.body = body; + s_out = screen_driver(&n_confirm_download_all_ucode, header_lines, i_con); + } - if (s_out && s_out->rc != CANCEL_FLAG) { + if (update_list && (!s_out || s_out->rc != CANCEL_FLAG)) { while (update_list) { elem = update_list; update_list = elem->next; update_ucode(elem->dev, elem->lfw); + free(elem->lfw); free(elem); } } - if (s_out) + if (s_out) { + rc = s_out->rc; free(s_out); + } - return 0; + return rc; } /** diff -puN iprconfig.h~iprutils_update_all_ucodes_fixes iprconfig.h --- iprutils.patch/iprconfig.h~iprutils_update_all_ucodes_fixes 2015-09-16 15:51:58.309500304 -0500 +++ iprutils.patch-bjking1/iprconfig.h 2015-09-16 16:00:46.626731409 -0500 @@ -1684,6 +1684,7 @@ const char *screen_status[] = { /* 90 */ __("Selected disk enclosure is in Unknown state. Please check your hardware support"), /* 91 */ __("Create disk array failed - can not mix 5XX and 4K disks."), /* 92 */ __("Create disk array failed - can not build with read intensive disks only."), + /* 93 */ __("All devices up to date"), /* NOTE: 127 maximum limit */ }; @@ -1783,6 +1784,7 @@ enum { RC_90_Enclosure_Is_Unknown, RC_91_Mixed_Logical_Blk_Size, RC_92_UNSUPT_REQ_BLK_DEV_CLASS, + RC_93_All_Up_To_Date, /* NOTE: 127 maximum limit */ }; _ ------------------------------------------------------------------------------ Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 _______________________________________________ Iprdd-devel mailing list Iprdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iprdd-devel