From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aravind Gopalakrishnan Subject: Re: [PATCH 1/2] x86, amd_ucode: Fix coverity issues found in cpu_request_microcode() Date: Wed, 30 Jul 2014 11:15:12 -0500 Message-ID: <53D91A10.9010105@amd.com> References: <1406736775-13247-1-git-send-email-aravind.gopalakrishnan@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406736775-13247-1-git-send-email-aravind.gopalakrishnan@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: andrew.cooper3@citrix.com, jbeulich@suse.com, keir@xen.org Cc: coverity@xenproject.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 7/30/2014 11:12 AM, Aravind Gopalakrishnan wrote: > This patch fixes issues found in CID 1229147(dead code) and > CID 1229148: possible resource leak of mc_amd due to goto out > statements. > > Reported-by: Andrew Cooper > Signed-off-by: Aravind Gopalakrishnan > --- > xen/arch/x86/microcode_amd.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c > index 14728a2..a2bdd20 100644 > --- a/xen/arch/x86/microcode_amd.c > +++ b/xen/arch/x86/microcode_amd.c > @@ -384,9 +384,12 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize) > while ( offset < bufsize ) > { > error = install_equiv_cpu_table(mc_amd, buf, &offset); > + if ( error ) { Darn. I just noticed this. Will modify this. I'll wait to see if there are more suggestions before I send a V2 for this. - Aravind.