Don't call the OSD destructor if the data slot is NULL
(since it's already not done on unused slots, which are indistinguishable to the caller). Approved by: bz (mentor)
This commit is contained in:
parent
6fca021096
commit
3dd4fac97c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191711
@ -297,8 +297,10 @@ do_osd_del(u_int type, struct osd *osd, u_int slot, int list_locked)
|
||||
OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot);
|
||||
return;
|
||||
}
|
||||
osd_destructors[type][slot - 1](osd->osd_slots[slot - 1]);
|
||||
osd->osd_slots[slot - 1] = NULL;
|
||||
if (osd->osd_slots[slot - 1] != NULL) {
|
||||
osd_destructors[type][slot - 1](osd->osd_slots[slot - 1]);
|
||||
osd->osd_slots[slot - 1] = NULL;
|
||||
}
|
||||
for (i = osd->osd_nslots - 1; i >= 0; i--) {
|
||||
if (osd->osd_slots[i] != NULL) {
|
||||
OSD_DEBUG("Slot still has a value (type=%u, slot=%u).",
|
||||
|
Loading…
Reference in New Issue
Block a user