[Skiboot] [PATCH] external/pflash: Perform the correct cleanup

Cyril Bur cyril.bur at au1.ibm.com
Fri Nov 11 15:25:49 AEDT 2016


On Fri, 2016-11-11 at 15:24 +1100, Stewart Smith wrote:
> Cyril Bur <cyril.bur at au1.ibm.com> writes:
> > If the -F flag is used then pflash uses a regular file as the
> > flash.
> > 
> > On cleanup pflash fails to tell arch_flash_close() if it had passed
> > a
> > filename to arch_flash_init() as such arch_flash_close() assumes
> > that
> > it needs to close the actual flash structure and not simply a file
> > descriptor leading to a NULL dereference.
> > 
> > Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
> > ---
> > Note: This fix is correct but I'm not particularly fond of it. A
> > better solution is to refactor and stop relying on atexit() to
> > perform
> > cleanup after the use of exit(). This cleanup would also benifit
> > debugging, this work and tests to avoid this situation in future is
> > in
> > my work queue.
> 
> Cool. I'll leave you to refactor it, but merge this now to master (as
> of
> 02a628a37982ebcc00f050d2a6a73aa6247718f2 ) so that it makse it into
> 5.4.0

Thanks.

> 



More information about the Skiboot mailing list