Skip to contentSkip to conversation

libxc: Fix CID 1351225 resource leak

PATCH In review Harmandeep Kaur 4 participants 4 messages Feb 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxc: Fix CID 1351225 resource leak

---
 tools/libxc/xc_offline_page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxc/xc_offline_page.c +1 -1
index bc91d51..3248a34 100644
@@ -504,7 +504,7 @@ int xc_exchange_page(xc_interface *xch, int domid, xen_pfn_t mfn)
     if ( xc_map_domain_meminfo(xch, domid, &minfo) )
     {
         PERROR("Could not map domain's memory information\n");
-        return -1;
+        goto failed;
     }
 
     /* For translation macros */
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Harmandeep,

Thanks for this patch.

Quoted 1 line · Harmandeep Kaur

In general, I think it would be best if the subject is a bit more "explicative", and if you add a few words of changelog, here, above the S-o-b.

In this case, this could be something like this.

Subject: "libxc: fix leak in xc_offline_page error path"

Changelog: "
Avoid leaking the mapping of the m2p in one of the possible failure cases.

Coverity CID 1351225
"

Quoted 2 lines

That being said, this case is very simple, so I'll leave it to the tools maintainers to tell whether they want something like what I described above in place or not.

The code looks ok to me, so, with or without the subject/changelog improvements:

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 18 lines · Dario Faggioli

Hi Harmandeep,

Thanks for this patch.

Quoted 1 line · Harmandeep Kaur

In general, I think it would be best if the subject is a bit more "explicative", and if you add a few words of changelog, here, above the S-o-b.

In this case, this could be something like this.

Subject: "libxc: fix leak in xc_offline_page error path"

Changelog: "
Avoid leaking the mapping of the m2p in one of the possible failure cases.

Quoted 8 lines

Coverity CID 1351225
"

Quoted 2 lines

That being said, this case is very simple, so I'll leave it to the tools maintainers to tell whether they want something like what I described above in place or not.

I was going to comment the same, so yes please. The subject and commit message should describe the actual change and the CID should simply be referenced as Dario has in his example.

Quoted 8 lines

The code looks ok to me, so, with or without the subject/changelog improvements:

Regards,
Dario

#3 lore raw
In reply to Dario Faggioli

Dario Faggioli writes ("Re: [PATCH] libxc: Fix CID 1351225 resource leak"):

Quoted 3 lines

That being said, this case is very simple, so I'll leave it to the tools maintainers to tell whether they want something like what I described above in place or not.

I agree that what you suggest would be better. The committer could fold in your suggestions at the time of commit, but it would be nicer to have a formal v2 with an updated commit message.

Quoted 1 line

Thanks.

Ian.