Re: [PATCH v3 2/2] staging: fbtft: cleanup error handling in fbtft_framebuffer_alloc()

From: Greg KH
Date: Mon Jun 30 2025 - 13:16:47 EST


On Sun, Jun 29, 2025 at 08:10:11PM +0530, Abdun Nihaal wrote:
> The error handling in fbtft_framebuffer_alloc() mixes managed allocation
> and plain allocation, and performs error handling in an order different
> from the order in fbtft_framebuffer_release().
>
> Fix them by moving vmem allocation closer to where it is used, and using
> plain kzalloc() for txbuf allocation.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Abdun Nihaal <abdun.nihaal@xxxxxxxxx>
> ---
> v2->v3:
> - Remove the if check before kfree of txbuf.buf, because it is zero
> initialized on allocation, and kfree is NULL aware.

This patch does not apply to my tree, can you rebase and resend?

thanks,

greg k-h