Re: [PATCH] scsi: pmcraid: Fix memory allocation in 'pmcraid_alloc_sglist()'

From: Martin K. Petersen
Date: Tue Oct 06 2020 - 23:05:10 EST



> When the scatter list is allocated in 'pmcraid_alloc_sglist()', the
> corresponding pointer should be stored in 'scatterlist' within the
> 'pmcraid_sglist' structure. Otherwise, 'scatterlist' is NULL.
>
> This leads to a potential memory leak and NULL pointer dereference.

> Fixes: ed4414cef2ad ("scsi: pmcraid: Use sgl_alloc_order() and sgl_free_order()")

This does indeed look odd. Bart?

--
Martin K. Petersen Oracle Linux Engineering