- struct ovsdb_txn_table *t;
- struct ovsdb_error *error;
-
- error = NULL;
- LIST_FOR_EACH (t, struct ovsdb_txn_table, node, &txn->txn_tables) {
- struct ovsdb_table *table = t->table;
- struct ovsdb_txn_row *r;
-
- HMAP_FOR_EACH (r, struct ovsdb_txn_row, hmap_node, &t->txn_rows) {
- struct shash_node *node;
-
- SHASH_FOR_EACH (node, &table->schema->columns) {
- const struct ovsdb_column *column = node->data;
-
- if (r->old) {
- ovsdb_txn_adjust_row_refs(r->old, column, -delta, NULL);
- }
- if (r->new) {
- ovsdb_txn_adjust_row_refs(r->new, column, delta, &error);
- }
+ struct ovsdb_table *table = r->old ? r->old->table : r->new->table;
+ struct shash_node *node;
+
+ SHASH_FOR_EACH (node, &table->schema->columns) {
+ const struct ovsdb_column *column = node->data;
+ struct ovsdb_error *error;
+
+ if (r->old) {
+ error = ovsdb_txn_adjust_row_refs(txn, r->old, column, -1);
+ if (error) {
+ ovsdb_error_destroy(error);
+ return OVSDB_BUG("error decreasing refcount");
+ }
+ }
+ if (r->new) {
+ error = ovsdb_txn_adjust_row_refs(txn, r->new, column, 1);
+ if (error) {
+ return error;