Skip to content

Commit

Permalink
drivers:misc: ti-st: fix skipping of change remote baud
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shahar Lev authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent bb2b43f commit 9d031d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/ti-st/st_kim.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len)
pr_err("invalid action after change remote baud command");
} else {
*ptr = *ptr + sizeof(struct bts_action) +
((struct bts_action *)nxt_action)->size;
((struct bts_action *)cur_action)->size;
*len = *len - (sizeof(struct bts_action) +
((struct bts_action *)nxt_action)->size);
((struct bts_action *)cur_action)->size);
/* warn user on not commenting these in firmware */
pr_warn("skipping the wait event of change remote baud");
}
Expand Down

0 comments on commit 9d031d9

Please sign in to comment.