On Fri, Sep 16, 2011 at 03:49:28PM -0500, Eric Sandeen wrote: > In inode_open(), if the allocation of &io fails, we go to cleanup > and dereference io to test io->name, which is a bug. > > Similarly in undo_open() if allocation of &data fails, we > go to cleanup and dereference data to test data->real. > > In the test_open() case we explicitly set retval to the only > possible error return from ext2fs_get_mem(), so remove that > for tidiness. > > The other changes just make make earlier returns go through > the error goto for consistency. > > In many cases we returned directly from the first error, but > "goto cleanup" etc for every subsequent error. In some > cases this leads to "impossible" tests such as: > > if (ptr) > ext2fs_free_mem(&ptr) > > on paths where ptr cannot be null because we would have > returned directly earlier, and Coverity flags this. > > This isn't really indicative of an error in most cases, but > I think it can be clearer to always exit through the error goto > if it's used later in the function. > > Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx> Applied, thanks. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html