358,13 → 358,16 |
if (cloned_phone < phone) { |
mutex_lock(&cloned_phone->lock); |
mutex_lock(&phone->lock); |
} else if (cloned_phone > phone) { |
mutex_lock(&phone->lock); |
mutex_lock(&cloned_phone->lock); |
} else { |
mutex_lock(&phone->lock); |
mutex_lock(&cloned_phone->lock); |
} |
if ((cloned_phone->state != IPC_PHONE_CONNECTED) || |
phone->state != IPC_PHONE_CONNECTED) { |
mutex_unlock(&cloned_phone->lock); |
if (cloned_phone != phone) |
mutex_unlock(&cloned_phone->lock); |
mutex_unlock(&phone->lock); |
return EINVAL; |
} |
376,13 → 379,15 |
*/ |
newphid = phone_alloc(phone->callee->task); |
if (newphid < 0) { |
mutex_unlock(&cloned_phone->lock); |
if (cloned_phone != phone) |
mutex_unlock(&cloned_phone->lock); |
mutex_unlock(&phone->lock); |
return ELIMIT; |
} |
ipc_phone_connect(&phone->callee->task->phones[newphid], |
cloned_phone->callee); |
mutex_unlock(&cloned_phone->lock); |
if (cloned_phone != phone) |
mutex_unlock(&cloned_phone->lock); |
mutex_unlock(&phone->lock); |
/* Set the new phone for the callee. */ |
IPC_SET_ARG1(call->data, newphid); |