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: Gustavo Solaira <gustavos@codeaurora.org>
This commit is contained in:
Gustavo Solaira 2018-08-03 19:08:46 -07:00
parent 11ee621aea
commit f185067e36

View file

@ -328,13 +328,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);
return;
fail: