diff --git a/drivers/misc/google-easel-comm-hw.c b/drivers/misc/google-easel-comm-hw.c index e3151e5782e5..c3c05461a646 100644 --- a/drivers/misc/google-easel-comm-hw.c +++ b/drivers/misc/google-easel-comm-hw.c @@ -534,6 +534,7 @@ void easelcomm_hw_destroy_scatterlist(void *sglocaldata) /* Release sgl retrieved from dma_buf framework */ mnh_sg_release_from_dma_buf(sg_local_data); } + kfree(sg_local_data); } } EXPORT_SYMBOL(easelcomm_hw_destroy_scatterlist); diff --git a/drivers/misc/google-easel-comm-private.h b/drivers/misc/google-easel-comm-private.h index f00d69425625..6a2e856cf46f 100644 --- a/drivers/misc/google-easel-comm-private.h +++ b/drivers/misc/google-easel-comm-private.h @@ -44,11 +44,21 @@ enum easelcomm_msg_type { * transfer have default values for these. */ struct easelcomm_dma_xfer_info { - /* The local MNH driver scatter-gather list, or NULL if discarding */ + /* + * The local MNH driver scatter-gather list, or NULL if discarding. + * This points to an array of mnh_sg_entry. Content of this is + * to be used to combine with remote scatter-gather list to be a + * DMA Linked List. + */ void *sg_local; /* Size in bytes of the local scatter-gather list, zero if discard */ uint32_t sg_local_size; - /* Local data private to the MNH layer associated with the SG list */ + /* + * Local data private to the MNH layer associated with the SG list. + * This points to mnh_sg_list. It marks information of + * the buffer for DMA transfer, and is used to collect local MNH + * driver scatter-gather list (sg_local). + */ void *sg_local_localdata; /* * Easel/server keeps the remote scatter-gather list received from the