test/unit/scsi: initialize prev_lun

Otherwise compiler complains that this variable
is used uninitialized (scsi_dev_find_free_lun does
reference it).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8fce604f22e06f7007669510f8ba0ae27c44261a

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9868
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2021-10-13 08:40:08 -07:00 committed by Tomasz Zawadzki
parent b0a52577a2
commit 15535803d4

View File

@ -664,7 +664,7 @@ static void
dev_find_free_lun(void)
{
struct spdk_scsi_dev dev = { .luns = TAILQ_HEAD_INITIALIZER(dev.luns), };
struct spdk_scsi_lun *lun, *prev_lun;
struct spdk_scsi_lun *lun, *prev_lun = NULL;
int i, rc;
lun = calloc(SPDK_SCSI_DEV_MAX_LUN, sizeof(*lun));