Re: [PATCH v2 17/18] firmware: arm_ffa: Add support for handling framework notifications
From: Viresh Kumar
Date: Mon Feb 10 2025 - 05:17:57 EST
On 31-01-25, 11:24, Sudeep Holla wrote:
> +static void handle_fwk_notif_callbacks(u32 bitmap)
> +{
> + void *buf;
> + uuid_t uuid;
> + int notify_id = 0, target;
> + struct ffa_indirect_msg_hdr *msg;
> + struct notifier_cb_info *cb_info = NULL;
> +
> + /* Only one framework notification defined and supported for now */
> + if (!(bitmap & FRAMEWORK_NOTIFY_RX_BUFFER_FULL))
> + return;
> +
> + mutex_lock(&drv_info->rx_lock);
> +
> + msg = drv_info->rx_buffer;
> + buf = kmalloc(msg->size, GFP_KERNEL);
> + if (!buf) {
> + mutex_unlock(&drv_info->rx_lock);
> + return;
> + }
> + memcpy(buf, (void *)msg + msg->offset, msg->size);
Can use kmemdup() here instead.
--
viresh