sim/sim_rptun: Check if the shared memory has been allocated

Bug fix

Signed-off-by: yintao <yintao@xiaomi.com>
This commit is contained in:
yintao
2024-09-14 17:34:52 +08:00
committed by archer
parent 4f14f8226a
commit 5a04670600
+5
View File
@@ -102,6 +102,11 @@ sim_rptun_get_resource(struct rptun_dev_s *dev)
priv->shmem = host_allocshmem(priv->shmemname,
sizeof(*priv->shmem));
if (!priv->shmem)
{
return NULL;
}
if (priv->master)
{
struct rptun_rsc_s *rsc = &priv->shmem->rsc;