All of lore.kernel.org
 help / color / mirror / Atom feed
* Recent multipath-tools patches from Huawei
@ 2020-08-10 14:34 Martin Wilck
  2020-08-11  1:14 ` Zhiqiang Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Wilck @ 2020-08-10 14:34 UTC (permalink / raw)
  To: Zhiqiang Liu, linfeilong, Yanxiaodan, lixiaokeng; +Cc: dm-devel

Hi Liu,

thanks again for your valuable contributions and meticulous code
review. I've added your patches in my upstream-queue branch now:

https://github.com/openSUSE/multipath-tools/commits/upstream-queue

Not applied yet: 

 - libmultipath: free pp if store_path fails in disassemble_map:
   As noted before, this will be merged with my series for
   disassemble_map().
 - libmultipath: fix a memory leak in set_ble_device:
   Please fix minor issues I mentioned
 - vector: return null when realloc fails in vector_alloc_slot func
   Needs improvement

Please double-check if I've missed anything. 

Next time, please send your patches as a series. That makes it
much easier for others to make sure they don't miss any.
And please, don't add "[dm-devel]" explicitly in your email
subject, mailman will take care of that.

Regards
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Recent multipath-tools patches from Huawei
  2020-08-10 14:34 Recent multipath-tools patches from Huawei Martin Wilck
@ 2020-08-11  1:14 ` Zhiqiang Liu
  2020-08-11  9:49   ` Martin Wilck
  0 siblings, 1 reply; 3+ messages in thread
From: Zhiqiang Liu @ 2020-08-11  1:14 UTC (permalink / raw)
  To: Martin Wilck, linfeilong, Yanxiaodan, lixiaokeng; +Cc: dm-devel



On 2020/8/10 22:34, Martin Wilck wrote:
> Hi Liu,
> 
> thanks again for your valuable contributions and meticulous code
> review. I've added your patches in my upstream-queue branch now:
> 
> https://github.com/openSUSE/multipath-tools/commits/upstream-queue
> 
> Not applied yet: 
> 
>  - libmultipath: free pp if store_path fails in disassemble_map:
>    As noted before, this will be merged with my series for
>    disassemble_map().
>  - libmultipath: fix a memory leak in set_ble_device:
>    Please fix minor issues I mentioned
>  - vector: return null when realloc fails in vector_alloc_slot func
>    Needs improvement
> 
> Please double-check if I've missed anything. 
> 
> Next time, please send your patches as a series. That makes it
> much easier for others to make sure they don't miss any.
> And please, don't add "[dm-devel]" explicitly in your email
> subject, mailman will take care of that.
> 
> Regards
> Martin
> 
Thanks for your advise.
I have checked recent patches. The following patch may be missed.
- libmultipath: free pgp if add_pathgroup fails in disassemble_map func




From e43d45a4ff838cab845bc5b5834d24743192eb75 Mon Sep 17 00:00:00 2001
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Date: Wed, 22 Jul 2020 14:31:15 +0800
Subject: [PATCH] libmultipath: free pgp if add_pathgroup fails in disassemble_map

In disassemble_map func, pgp will be added to mpp->pg by calling
add_pathgroup after allocing a pathgroup (pgp) successfully. However,
if add_pathgroup fails, the pgp is actually not inserted into mpp->pg.
So, calling free_pgvec(mpp->pg) cannot free the pgp, then memory leak
problem occurs.

disassemble_map:
-> pgp = alloc_pathgroup()
-> if add_pathgroup(mpp, pgp) fails
	-> goto out
out:
free_pgvec(mpp->pg, KEEP_PATHS);

Here, we will call free_pathgroup(pgp) before going to out tag.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: lixiaokeng <lixiaokeng@huawei.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/dmparser.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index ac13ec06..6225838b 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -268,8 +268,10 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp,
 		if (!pgp)
 			goto out;

-		if (add_pathgroup(mpp, pgp))
+		if (add_pathgroup(mpp, pgp)) {
+			free_pathgroup(pgp, KEEP_PATHS);
 			goto out;
+		}

 		p += get_word(p, &word);

-- 
2.24.0.windows.2





> 
> 
> .
> 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Recent multipath-tools patches from Huawei
  2020-08-11  1:14 ` Zhiqiang Liu
@ 2020-08-11  9:49   ` Martin Wilck
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Wilck @ 2020-08-11  9:49 UTC (permalink / raw)
  To: Zhiqiang Liu, linfeilong, Yanxiaodan, lixiaokeng; +Cc: dm-devel

On Tue, 2020-08-11 at 09:14 +0800, Zhiqiang Liu wrote:
> 
> On 2020/8/10 22:34, Martin Wilck wrote:
> > Hi Liu,
> > 
> > thanks again for your valuable contributions and meticulous code
> > review. I've added your patches in my upstream-queue branch now:
> > 
> > https://github.com/openSUSE/multipath-tools/commits/upstream-queue
> > 
> > Not applied yet: 
> > 
> >  - libmultipath: free pp if store_path fails in disassemble_map:
> >    As noted before, this will be merged with my series for
> >    disassemble_map().
> >  - libmultipath: fix a memory leak in set_ble_device:
> >    Please fix minor issues I mentioned
> >  - vector: return null when realloc fails in vector_alloc_slot func
> >    Needs improvement
> > 
> > Please double-check if I've missed anything. 
> > 
> > Next time, please send your patches as a series. That makes it
> > much easier for others to make sure they don't miss any.
> > And please, don't add "[dm-devel]" explicitly in your email
> > subject, mailman will take care of that.
> > 
> > Regards
> > Martin
> > 
> Thanks for your advise.
> I have checked recent patches. The following patch may be missed.
> - libmultipath: free pgp if add_pathgroup fails in disassemble_map
> func

Right. Sorry for overlooking it, I pushed it now.

Regards,
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-11  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 14:34 Recent multipath-tools patches from Huawei Martin Wilck
2020-08-11  1:14 ` Zhiqiang Liu
2020-08-11  9:49   ` Martin Wilck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.