mirror of
https://github.com/apache/nuttx.git
synced 2026-08-26 11:50:50 +00:00
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:
parent
4f14f8226a
commit
5a04670600
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue