diff --git a/meta/Meta.cpp b/meta/Meta.cpp index 354b8c7f1f05..6e1637cdce2e 100644 --- a/meta/Meta.cpp +++ b/meta/Meta.cpp @@ -2958,7 +2958,7 @@ sai_status_t Meta::meta_generic_validation_remove( SWSS_LOG_ERROR("object 0x%" PRIx64 " reference count is %d, can't remove", oid, count); - return SAI_STATUS_INVALID_PARAMETER; + return SAI_STATUS_OBJECT_IN_USE; } if (meta_key.objecttype == SAI_OBJECT_TYPE_PORT) @@ -2987,14 +2987,6 @@ sai_status_t Meta::meta_port_remove_validation( return SAI_STATUS_SUCCESS; } - if (m_oids.getObjectReferenceCount(port_id) != 0) - { - SWSS_LOG_ERROR("port %s reference count is not zero, can't remove", - sai_serialize_object_id(port_id).c_str()); - - return SAI_STATUS_OBJECT_IN_USE; - } - if (!meta_is_object_in_default_state(port_id)) { SWSS_LOG_ERROR("port %s is not in default state, can't remove",