- bt_graph_notify_port_added(graph, new_port);
- BT_OBJECT_PUT_REF_AND_RESET(graph);
+ enum bt_graph_listener_status listener_status;
+
+ listener_status = bt_graph_notify_port_added(graph, new_port);
+ if (listener_status != BT_GRAPH_LISTENER_STATUS_OK) {
+ bt_graph_make_faulty(graph);
+ status = listener_status;
+ goto error;
+ }