mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Shahar Lev <shahar@wizery.com>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 4/9] drivers:misc: ti-st: fix skipping of change remote baud
Date: Tue, 28 Jun 2011 09:02:01 -0700	[thread overview]
Message-ID: <1309276926-1327-4-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1309276926-1327-1-git-send-email-gregkh@suse.de>

From: Shahar Lev <shahar@wizery.com>

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>
---
 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 3613c3b..38fd2f0 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)
 		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");
 	}
-- 
1.7.5.4


  parent reply	other threads:[~2011-06-28 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 15:39 [GIT PATCH] driver core fixes for 3.0 Greg KH
2011-06-28 16:01 ` [PATCH 1/9] firmware: fix GOOGLE_SMI kconfig dependency warning Greg Kroah-Hartman
2011-06-28 16:01   ` [PATCH 2/9] st_kim: Handle case of no device found for ID 0 Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 3/9] drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module Greg Kroah-Hartman
2011-06-28 16:02   ` Greg Kroah-Hartman [this message]
2011-06-28 16:02   ` [PATCH 5/9] pti: double-free security PTI fix Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 6/9] pti: ENXIO error case memory leak " Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 7/9] pti: PTI semantics fix in pti_tty_cleanup Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309276926-1327-4-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shahar@wizery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®