spa: bluez: telephony: reject double registration

This commit is contained in:
Barnabás Pőcze 2025-11-03 22:42:35 +01:00 committed by Wim Taymans
parent 9a0053a501
commit 78b6df769b

View file

@ -1153,6 +1153,9 @@ int telephony_ag_register(struct spa_bt_telephony_ag *ag)
.message_function = ag_handler, .message_function = ag_handler,
}; };
if (agimpl->path)
return -EBUSY;
spa_autofree char *path = spa_aprintf(PW_TELEPHONY_OBJECT_PATH "/ag%d", agimpl->this.id); spa_autofree char *path = spa_aprintf(PW_TELEPHONY_OBJECT_PATH "/ag%d", agimpl->this.id);
/* register object */ /* register object */
@ -1651,6 +1654,9 @@ int telephony_call_register(struct spa_bt_telephony_call *call)
.message_function = call_handler, .message_function = call_handler,
}; };
if (callimpl->path)
return -EBUSY;
spa_autofree char *path = spa_aprintf("%s/call%d", agimpl->path, callimpl->this.id); spa_autofree char *path = spa_aprintf("%s/call%d", agimpl->path, callimpl->this.id);
/* register object */ /* register object */