cxlflash: Correct usage of scsi_host_put()
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: NMatthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: NManoj N. Kumar <manoj@linux.vnet.ibm.com> Reviewed-by: NBrian King <brking@linux.vnet.ibm.com> Reviewed-by: NTomas Henzl <thenzl@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
Showing
想要评论请 注册 或 登录