On Fri, Mar 15, 2013 at 12:37:05AM +0100, David Sterba wrote:
> On Tue, Mar 12, 2013 at 01:38:17PM -0400, Josef Bacik wrote:
> > --- a/cmds-restore.c
> > +++ b/cmds-restore.c
> > +   if (list_roots) {
> > +           int ret = do_list_roots(fs_info->tree_root);
> > +           if (ret) {
> > +                   close_ctree(fs_info->tree_root);
> >                     root = NULL;
> 
> Setting root to NULL here has no effect, I wonder if this should be
> 'return NULL' instead, or if it's really ok to return fs_info->fs_root
> even after close_ctree() which calls free_fs_roots and other cleanups.

It's no ok, close_tree does free(fs_info), so it's returning garbage,
the caller jumps to (another) close_ctree if it's in list_root mode (and
trying to free the fs_info again).

> 
> >             }
> >     }
> >  
> > -   return root;
> > +   return fs_info->fs_root;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to