[PATCH v6 20/37] cxlflash: Fix to prevent workq from accessing freed memory

Tomas Henzl thenzl at redhat.com
Sat Oct 24 00:41:35 AEDT 2015


On 21.10.2015 22:14, Matthew R. Ochs wrote:
> The workq can process work in parallel with a remove event, leading
> to a condition where the workq handler can access freed memory.
>
> To remedy, the workq should be terminated prior to freeing memory. Move
> the termination call earlier in remove and use cancel_work_sync() instead
> of flush_work() as there is not a need to process any scheduled work when
> shutting down.
>
> Signed-off-by: Matthew R. Ochs <mrochs at linux.vnet.ibm.com>
> Signed-off-by: Manoj N. Kumar <manoj at linux.vnet.ibm.com>
> Reviewed-by: Brian King <brking at linux.vnet.ibm.com>

Reviewed-by: Tomas Henzl <thenzl at redhat.com>

Tomas



More information about the Linuxppc-dev mailing list