Hi Grant, In-Reply-To: <1297982431-9098-1-git-send-email-maratho...@gmail.com>
On Thu, Feb 17, 2011 at 02:40:31PM -0800, Grant Erickson wrote: > Added debugging statements and ensure, following calls to g_free, that > the statistics file name field is set to NULL to ensure that a failed > file mapping and a subsequent call to stats_free doesn't fault when > trying to double-free it. > > Added an informational message when mmap fails with EINVAL in > stats_file_remap. > > Signed-off-by: Grant Erickson <maratho...@gmail.com> > > diff --git a/src/stats.c b/src/stats.c > index 679a372..243a9b8 100644 > --- a/src/stats.c > +++ b/src/stats.c > @@ -214,26 +214,27 @@ static void stats_free(gpointer user_data) > { > struct stats_file *file = user_data; > > - msync(file->addr, file->len, MS_SYNC); > + if (file) { > + msync(file->addr, file->len, MS_SYNC); Prefered style in ConnMan is to have an early exist, e.g. if (file == NULL) return; Would you mind to update your patch accordingly? thanks, daniel _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman