On 12/21/2017 07:04 PM, Ying Xue wrote: > On 12/21/2017 04:13 PM, Tommi Rantala wrote: >> Fix error path memory leak in tipc_enable_bearer(). >> >> Signed-off-by: Tommi Rantala <[email protected]>
Acked-by: Ying Xue <[email protected]> It's better that the patch can solve another memory leak as I mentioned below. >> --- >> net/tipc/bearer.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c >> index 47ec121574ce..f3c65e1ec537 100644 >> --- a/net/tipc/bearer.c >> +++ b/net/tipc/bearer.c >> @@ -324,6 +324,7 @@ static int tipc_enable_bearer(struct net *net, const >> char *name, >> if (res) { >> pr_warn("Bearer <%s> rejected, enable failure (%d)\n", >> name, -res); >> + kfree(b); >> return -EINVAL; > > Good catch. But after I take a closer look at the code, it's found there > are another similar memory leak in tipc_enable_bearer(): > > if (tipc_mon_create(net, bearer_id)) > return -ENOMEM; > > So I suggest you should solve it together with it. > > Thanks, > Ying > >> } >> >> > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > tipc-discussion mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/tipc-discussion > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ tipc-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tipc-discussion
