Re: [PATCH v4 3/4] scsi: ufs: core: Make ufshcd_uic_cmd_compl() easier to analyze

Peter Wang (王信友)
2024-09-13T07:06:55Z

On Thu, 2024-09-12 at 15:30 -0700, Bart Van Assche wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> In ufshcd_uic_cmd_compl(), there is code that dereferences 'cmd'
> with
> and without checking the 'cmd' pointer. This confuses static source
> code
> analyzers like Coverity and sparse. Since none of the code in
> ufshcd_uic_cmd_compl() can do anything useful if 'cmd' is NULL, move
> the
> 'cmd' test near the start of this function.
>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>
>

Reviewed-by: Peter Wang <peter.wang@mediatek.com>