Re: [PATCH v2] consolemap: Fix a memory leaking bug in con_insert_unipair()

2019-05-24 Thread Greg KH
On Fri, May 24, 2019 at 10:19:32AM +0800, Gen Zhang wrote: > In function con_insert_unipair(), when allocation for p2 and p1[n] > fails, ENOMEM is returned, but previously allocated p1 is not freed, > remains as leaking memory. Thus we should free p1 as well when this > allocation fails. > > Sign

[PATCH v2] consolemap: Fix a memory leaking bug in con_insert_unipair()

2019-05-23 Thread Gen Zhang
In function con_insert_unipair(), when allocation for p2 and p1[n] fails, ENOMEM is returned, but previously allocated p1 is not freed, remains as leaking memory. Thus we should free p1 as well when this allocation fails. Signed-off-by: Gen Zhang Reviewed-by: Kees Cook --- diff --git a/drivers/