Skip to content

Commit 7a8527e

Browse files
xiaoxiang781216arnopo
authored andcommitted
rpmsg: rpmsg_create_ept return RPMSG_ERR_ADDR if the address is in use
any error should return back to caller Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent ff798a9 commit 7a8527e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/rpmsg/rpmsg.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,17 @@ int rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,
215215
rpmsg_set_address(rdev->bitmap, RPMSG_ADDR_BMP_SIZE,
216216
src);
217217
} else if (status > 0) {
218-
status = RPMSG_SUCCESS;
218+
status = RPMSG_ERR_ADDR;
219219
goto ret_status;
220220
} else {
221221
goto ret_status;
222222
}
223223
} else {
224224
addr = rpmsg_get_address(rdev->bitmap, RPMSG_ADDR_BMP_SIZE);
225+
if (addr == RPMSG_ADDR_ANY) {
226+
status = RPMSG_ERR_ADDR;
227+
goto ret_status;
228+
}
225229
}
226230

227231
rpmsg_init_ept(ept, name, addr, dest, cb, unbind_cb);

0 commit comments

Comments
 (0)