lkml.org 
[lkml]   [2023]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] spi: sun4i: Fix memory leak on device removal
On Mon, Oct 02, 2023 at 02:29:59PM +0800, Woody Zhang wrote:

> Call spi_master_put to free the spi_master structure on device removal
> and driver detachment.

> static void sun4i_spi_remove(struct platform_device *pdev)
> {
> + struct spi_master *master = dev_get_drvdata(&pdev->dev);
> +
> pm_runtime_force_suspend(&pdev->dev);
> + spi_master_put(master);
> }

This is just obviously buggy, it doesn't match the registration at all.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-10-02 15:03    [W:0.112 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site