scsi: ensure bdlen is initialized before use

This fixes a false positive warning when building on GCC 7.2.1 with
CONFIG_COVERAGE=y.

bdlen is always initialized on the path where it can be used, but the
compiler seems to get confused when coverage is enabled, so zero out the
value at the top of the function.

Change-Id: Ifc13abff80124cad3d26286ffebf84f967141d13
Reported-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/396244
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2018-01-24 13:23:17 -07:00 committed by Jim Harris
parent 8be76f8589
commit 88da45bfd0

View File

@ -1781,7 +1781,7 @@ spdk_bdev_scsi_process_primary(struct spdk_scsi_task *task)
int rc = 0;
int pllen, md = 0;
int pf, sp;
int bdlen, llba;
int bdlen = 0, llba;
int dbd, pc, page, subpage;
int cmd_parsed = 0;