RE: [PATCH] scsi: ufs: core: initialize sg_cnt, sg_list

From: Avri Altman
Date: Fri Jan 06 2023 - 03:20:00 EST


> The clang build fails with
> drivers/ufs/core/ufs_bsg.c:107:6: error: variable 'sg_cnt' is used
> uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-
> uninitialized]
> if (dir != DMA_NONE) {
> ^~~~~~~~~~~~~~~
> Similar for sg_list.
>
> This is not an error because ufshcd_advanced_rpmb_req_handler() does a
> similar check, but that check can be reduced if sg_list is initialized to NULL.
> Initialize sg_cnt to silence its error.
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
I think that Bean already submitted a fix for that.

Thanks,
Avri