module-adapter: handle errors with NULL resource

This commit is contained in:
Wim Taymans 2019-07-15 17:11:46 +02:00
parent 453e75a23e
commit 1a6fe0e023

View file

@ -168,19 +168,23 @@ static void *create_object(void *_data,
error_properties:
res = -EINVAL;
pw_log_error("factory %p: usage: " FACTORY_USAGE, d->this);
if (resource)
pw_resource_error(resource, res, "usage: " FACTORY_USAGE);
goto error_cleanup;
error_no_mem:
res = -errno;
pw_log_error("can't create node: %m");
if (resource)
pw_resource_error(resource, res, "can't create node: %s", spa_strerror(res));
goto error_cleanup;
error_usage:
res = -EINVAL;
pw_log_error("usage: "ADAPTER_USAGE);
if (resource)
pw_resource_error(resource, res, "usage: "ADAPTER_USAGE);
goto error_cleanup;
error_bind:
if (resource)
pw_resource_error(resource, res, "can't bind adapter node");
goto error_cleanup;
error_cleanup: