[PATCH v6 19/37] cxlflash: Correct usage of scsi_host_put()

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


On 21.10.2015 22:14, Matthew R. Ochs wrote:
> Currently, scsi_host_put() is being called prematurely in the
> remove path and is missing entirely in an error cleanup path.
> The former can lead to memory being freed too early with
> subsequent access potentially corrupting data whilst the former
> would result in a memory leak.
>
> Move the usage on remove to be the last cleanup action taken
> and introduce a call to scsi_host_put() in the one initialization
> error path that does not use remove to cleanup.
>
> 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