Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8b897be authored by Mulu He's avatar Mulu He
Browse files

coresight: stm: Out of bound access from STM



The memory size allocated for stm_master is less than it's defined.

Change-Id: Ia913ac899c069383cff498b03815d985dacacdf4
Signed-off-by: default avatarMulu He <muluhe@codeaurora.org>
parent f82ab04c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -174,8 +174,9 @@ static int stp_master_alloc(struct stm_device *stm, unsigned int idx)
{
	struct stp_master *master;
	size_t size;
	unsigned long align = sizeof(unsigned long);

	size = ALIGN(stm->data->sw_nchannels, 8) / 8;
	size = ALIGN(stm->data->sw_nchannels, align) / align;
	size += sizeof(struct stp_master);
	master = kzalloc(size, GFP_ATOMIC);
	if (!master)