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

Commit b44b1cf6 authored by Gustavo Solaira's avatar Gustavo Solaira Committed by Gerrit - the friendly Code Review server
Browse files

diag: Fix HSIC read complete work function



Only call kfree if the item is valid and drain
the whole buffer before leaving the work function.

Change-Id: Ie9c253c394be1aa859789262e0f03a986a4ad207
Signed-off-by: default avatarGustavo Solaira <gustavos@codeaurora.org>
parent 47d3f671
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -327,13 +327,16 @@ static void hsic_read_complete_work_fn(struct work_struct *work)
						 read_complete_work);
	struct diag_hsic_buf_tbl_t *item;

	do {
		item = hsic_buf_tbl_pop(ch);
		if (item) {
		if (diag_remote_dev_read_done(ch->dev_id, item->buf, item->len))
			if (diag_remote_dev_read_done(ch->dev_id,
						      item->buf, item->len))
				goto fail;
			kfree(item);
		}
	} while (item);

	kfree(item);
	return;

fail: