diff options
author | Shahar Lev <shahar@wizery.com> | 2011-05-23 04:36:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 13:01:18 -0400 |
commit | 9d031d94da453077bbc6108b7822fc751ac85299 (patch) | |
tree | 35c58ae8741e5cb79d422b05eb9ce14dfeac3568 /drivers | |
parent | bb2b43fefab723f4a0760146e7bed59d41a50e53 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/ti-st/st_kim.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 3613c3bc4da3..38fd2f04c07e 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c | |||
@@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len) | |||
245 | pr_err("invalid action after change remote baud command"); | 245 | pr_err("invalid action after change remote baud command"); |
246 | } else { | 246 | } else { |
247 | *ptr = *ptr + sizeof(struct bts_action) + | 247 | *ptr = *ptr + sizeof(struct bts_action) + |
248 | ((struct bts_action *)nxt_action)->size; | 248 | ((struct bts_action *)cur_action)->size; |
249 | *len = *len - (sizeof(struct bts_action) + | 249 | *len = *len - (sizeof(struct bts_action) + |
250 | ((struct bts_action *)nxt_action)->size); | 250 | ((struct bts_action *)cur_action)->size); |
251 | /* warn user on not commenting these in firmware */ | 251 | /* warn user on not commenting these in firmware */ |
252 | pr_warn("skipping the wait event of change remote baud"); | 252 | pr_warn("skipping the wait event of change remote baud"); |
253 | } | 253 | } |