diff --git a/dsp/adsprpc.c b/dsp/adsprpc.c index 815ff28cfb..231764498c 100644 --- a/dsp/adsprpc.c +++ b/dsp/adsprpc.c @@ -4713,7 +4713,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl, int locked) match = NULL; spin_lock_irqsave(&me->hlock, irq_flags); hlist_for_each_entry_safe(map, n, &me->maps, hn) { - if (map->servloc_name && + if (map->servloc_name && fl && fl->servloc_name && !strcmp(map->servloc_name, fl->servloc_name)) { match = map; if (map->is_persistent && map->in_use) { @@ -8287,8 +8287,9 @@ static int __init fastrpc_device_init(void) VERIFY(err, NULL != (buf = kzalloc(sizeof(*buf), GFP_KERNEL))); if (err) { err = -ENOMEM; - ADSPRPC_WARN("%s: CMA alloc failed err 0x%x\n", + ADSPRPC_ERR("%s: CMA alloc failed err 0x%x\n", __func__, err); + goto device_create_bail; } INIT_HLIST_NODE(&buf->hn); buf->virt = region_vaddr; diff --git a/dsp/adsprpc_compat.c b/dsp/adsprpc_compat.c index 2f8cb0b18c..3cc60e220a 100644 --- a/dsp/adsprpc_compat.c +++ b/dsp/adsprpc_compat.c @@ -772,11 +772,16 @@ static int compat_fastrpc_get_dsp_info(struct fastrpc_file *fl, struct fastrpc_ioctl_capability *info = NULL; compat_uint_t u; int err = 0; + size_t info_size = 0; info32 = compat_ptr(arg); VERIFY(err, NULL != (info = kmalloc( sizeof(*info), GFP_KERNEL))); - + info_size = sizeof(*info); + if (err) { + ADSPRPC_ERR("allocation failed for size 0x%zx\n", info_size); + return err; + } err = get_user(u, &info32->domain); if (err) return err;