Skip to content

Commit 9d031d9

Browse files
Shahar Levgregkh
authored andcommitted
drivers:misc: ti-st: fix skipping of change remote baud
Before the incrementing of ptr in skip_change_remote_baud, it points to cur_action, but the increment is done by the size of nxt_action instead. This could cause ptr to not point to a bts_action structure, which is harmful for the increment of ptr done in download_firmware. Therefore, the skipping is first done for cur_action. Signed-off-by: Shahar Lev <shahar@wizery.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent bb2b43f commit 9d031d9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/misc/ti-st/st_kim.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len)
245245
pr_err("invalid action after change remote baud command");
246246
} else {
247247
*ptr = *ptr + sizeof(struct bts_action) +
248-
((struct bts_action *)nxt_action)->size;
248+
((struct bts_action *)cur_action)->size;
249249
*len = *len - (sizeof(struct bts_action) +
250-
((struct bts_action *)nxt_action)->size);
250+
((struct bts_action *)cur_action)->size);
251251
/* warn user on not commenting these in firmware */
252252
pr_warn("skipping the wait event of change remote baud");
253253
}

0 commit comments

Comments
 (0)