Re: [Intel-gfx] [PATCH] drm/i915/bios: fix a memory leak in generate_lfp_data_ptrs

2022-11-29 Thread Jani Nikula
On Fri, 25 Nov 2022, Jani Nikula wrote: > On Fri, 25 Nov 2022, Xia Fukun wrote: >> When (size != 0 || ptrs->lvds_ entries != 3), the program tries to >> free() the ptrs. However, the ptrs is not created by calling kzmalloc(), >> but is obtained by pointer offset operation. >> This may lead to mem

[Intel-gfx] [PATCH] drm/i915/bios: fix a memory leak in generate_lfp_data_ptrs

2022-11-28 Thread Xia Fukun
When (size != 0 || ptrs->lvds_ entries != 3), the program tries to free() the ptrs. However, the ptrs is not created by calling kzmalloc(), but is obtained by pointer offset operation. This may lead to memory leaks or undefined behavior. Fix this by replacing the arguments of kfree() with ptrs_blo

Re: [Intel-gfx] [PATCH] drm/i915/bios: fix a memory leak in generate_lfp_data_ptrs

2022-11-25 Thread Jani Nikula
On Fri, 25 Nov 2022, Xia Fukun wrote: > When (size != 0 || ptrs->lvds_ entries != 3), the program tries to > free() the ptrs. However, the ptrs is not created by calling kzmalloc(), > but is obtained by pointer offset operation. > This may lead to memory leaks or undefined behavior. Yeah probably