bkpPortal should be initialized beforehand

This patch is a follow up patch for the PR#46239.
The bkpPortal in DetachDisk() path should be initialized
before using it.
This commit is contained in:
mtanino 2017-06-05 10:22:57 -04:00
parent 0cff839317
commit 82ce37d973

View File

@ -334,6 +334,7 @@ func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, mntPath string) error {
// If the iscsi disk config is not found, fall back to the original behavior.
// This portal/iqn/iface is no longer referenced, log out.
// Extract the portal and iqn from device path.
bkpPortal = make([]string, 1)
bkpPortal[0], iqn, err = extractPortalAndIqn(device)
if err != nil {
return err