mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
free_plex, free_volume: Don't try to destroy the underlying device if
it doesn't exist. This can occur under
certain failure situations.
This commit is contained in:
parent
684873a192
commit
80d23b9669
1 changed files with 4 additions and 2 deletions
|
|
@ -823,7 +823,8 @@ free_plex(int plexno)
|
|||
Free(plex->sdnos);
|
||||
if (plex->lock)
|
||||
Free(plex->lock);
|
||||
destroy_dev(plex->dev);
|
||||
if (plex->dev)
|
||||
destroy_dev(plex->dev);
|
||||
bzero(plex, sizeof(struct plex)); /* and clear it out */
|
||||
plex->state = plex_unallocated;
|
||||
}
|
||||
|
|
@ -894,7 +895,8 @@ free_volume(int volno)
|
|||
struct volume *vol;
|
||||
|
||||
vol = &VOL[volno];
|
||||
destroy_dev(vol->dev);
|
||||
if (vol->dev)
|
||||
destroy_dev(vol->dev);
|
||||
bzero(vol, sizeof(struct volume)); /* and clear it out */
|
||||
vol->state = volume_unallocated;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue