scsi: ufs: Fix a race condition in the tracing code
authorBart Van Assche <bvanassche@acm.org>
Tue, 24 Dec 2019 22:02:46 +0000 (14:02 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Jan 2020 02:57:44 +0000 (21:57 -0500)
commiteacf36f5bebde5089dddb3d5bfcbeab530b01f8a
tree92f1ea40cc149f87bafe7906330140ad44aaa709
parent1b21b8f008c156686079c4c2b207c4a28a0a769d
scsi: ufs: Fix a race condition in the tracing code

Starting execution of a command before tracing a command may cause the
completion handler to free data while it is being traced. Fix this race by
tracing a command before it is submitted.

Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20191224220248.30138-5-bvanassche@acm.org
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c