diff --git a/drivers/misc/rpmsgdev.c b/drivers/misc/rpmsgdev.c index 3f801b1ccb..7e13875d31 100644 --- a/drivers/misc/rpmsgdev.c +++ b/drivers/misc/rpmsgdev.c @@ -1160,6 +1160,9 @@ int rpmsgdev_register(FAR const char *remotecpu, FAR const char *remotepath, return -EINVAL; } + DEBUGASSERT(strlen(remotepath) + RPMSGDEV_NAME_PREFIX_LEN <= + RPMSG_NAME_SIZE); + dev = kmm_zalloc(sizeof(*dev)); if (dev == NULL) { diff --git a/drivers/misc/rpmsgdev.h b/drivers/misc/rpmsgdev.h index f0254f1534..5d777950aa 100644 --- a/drivers/misc/rpmsgdev.h +++ b/drivers/misc/rpmsgdev.h @@ -33,8 +33,8 @@ * Pre-processor definitions ****************************************************************************/ -#define RPMSGDEV_NAME_PREFIX "rpmsgdev-" -#define RPMSGDEV_NAME_PREFIX_LEN 9 +#define RPMSGDEV_NAME_PREFIX "rpdev-" +#define RPMSGDEV_NAME_PREFIX_LEN 6 #define RPMSGDEV_OPEN 1 #define RPMSGDEV_CLOSE 2