[Skiboot] [PATCH] Free bl_prot_range on file_exit_close()

Cyril Bur cyrilbur at gmail.com
Wed Oct 28 16:28:52 AEDT 2015


On Wed, 28 Oct 2015 11:54:23 +1100
Samuel Mendoza-Jonas <sam.mj at au1.ibm.com> wrote:

Thanks :)

For completeness it would actually be better if there was a way to inform
blocklevel that it needs to free its resources, doing this nicely might will be
more than this easy and correct fix.

In the interest of not leaking memory this patch is good, we can always make a
nice blocklevel way in the future.

Reviewed-by: Cyril Bur <cyrilbur at gmail.com>

> Signed-off-by: Samuel Mendoza-Jonas <sam.mj at au1.ibm.com>
> ---
>  external/gard/test/test.sh | 1 -
>  libflash/file.c            | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  delete mode 120000 external/gard/test/test.sh
> 
> diff --git a/external/gard/test/test.sh b/external/gard/test/test.sh
> deleted file mode 120000
> index 386568f..0000000
> --- a/external/gard/test/test.sh
> +++ /dev/null
> @@ -1 +0,0 @@
> -../../test/test.sh
> \ No newline at end of file
> diff --git a/libflash/file.c b/libflash/file.c
> index df11271..0dbe610 100644

I've noticed this locally in my repo, unfortunately it looks like I have pushed
that problem, in 56f82b7131f26598e9dd8d20ce1dd4a5a599ff7d damn. 

I'll send a patch to fix that up.

> --- a/libflash/file.c
> +++ b/libflash/file.c
> @@ -277,6 +277,7 @@ void file_exit(struct blocklevel_device *bl)
>  {
>  	struct file_data *file_data;
>  	if (bl) {
> +		free(bl->ecc_prot.prot);
>  		file_data = container_of(bl, struct file_data, bl);
>  		free(file_data->name);
>  		free(file_data);



More information about the Skiboot mailing list