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:
parent
11ee621aea
commit
f185067e36
1 changed files with 9 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue