diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp index 04b9d0c917..4232b0dfc5 100644 --- a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp @@ -632,26 +632,23 @@ Volume::NodeAttributeAdded(ino_t id, Attribute *attribute) status_t Volume::NodeAttributeRemoved(ino_t id, Attribute *attribute) { - status_t error = (attribute ? B_OK : B_BAD_VALUE); - if (error == B_OK) { - // notify the respective attribute index - if (error == B_OK) { - if (AttributeIndex *index = FindAttributeIndex( - attribute->GetName(), attribute->GetType())) { - index->Removed(attribute); - } - } + if (attribute == NULL) + return B_BAD_VALUE; - // update live queries - if (error == B_OK && attribute->GetNode()) { - uint8 oldKey[kMaxIndexKeyLength]; - size_t oldLength; - attribute->GetKey(oldKey, &oldLength); - UpdateLiveQueries(NULL, attribute->GetNode(), attribute->GetName(), - attribute->GetType(), oldKey, oldLength, NULL, 0); - } + // notify the attribute index + if (AttributeIndex *index = attribute->GetIndex()) + index->Removed(attribute); + + // update live queries + if (attribute->GetNode() != NULL) { + uint8 oldKey[kMaxIndexKeyLength]; + size_t oldLength; + attribute->GetKey(oldKey, &oldLength); + UpdateLiveQueries(NULL, attribute->GetNode(), attribute->GetName(), + attribute->GetType(), oldKey, oldLength, NULL, 0); } - return error; + + return B_OK; }