All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balaji T K <balajitk@ti.com>
To: Venkatraman S <svenkatr@ti.com>, Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/5] mmc: omap_hsmmc: Avoid host->cmd dereference during data transfer failures
Date: Fri, 9 Nov 2012 21:18:24 +0530	[thread overview]
Message-ID: <509D25C8.5010609@ti.com> (raw)
In-Reply-To: <1352220737-14071-2-git-send-email-svenkatr@ti.com>

On Tuesday 06 November 2012 10:22 PM, Venkatraman S wrote:
> Sometimes, a error occurs just after the Command has been reported
> to be successful (CC=1) but before data transfer completes (TC=1).
> Setting end_cmd=1 here leads to a NULL pointer dereference of
> host->cmd as the command complete has previously been handled.
>
> Set end_cmd only when command complete has not been handled
> before, else a NULL pointer dereference occurs.
>
> CC: stable@vger.kernel.org

Removing stable list as this is not applicable for previous major
release. Sent a patch to fix the same in different way.

> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
>   drivers/mmc/host/omap_hsmmc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 5434fd8..06d2e03 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -996,7 +996,8 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
>   		else if (status & (CMD_CRC | DATA_CRC))
>   			hsmmc_command_incomplete(host, -EILSEQ);
>
> -		end_cmd = 1;
> +		if (host->cmd)
> +			end_cmd = 1;
>   		if (host->data || host->response_busy) {
>   			end_trans = 1;
>   			host->response_busy = 0;
>


  reply	other threads:[~2012-11-09 15:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-06 16:52 [PATCH 0/5] mmc: omap_hsmmc: Few patches for omap_hsmmc Venkatraman S
2012-11-06 16:52 ` [PATCH 1/5] mmc: omap_hsmmc: Avoid host->cmd dereference during data transfer failures Venkatraman S
2012-11-09 15:48   ` Balaji T K [this message]
2012-11-06 16:52 ` [PATCH 2/5] mmc: omap_hsmmc: Enable HSPE bit for high speed cards Venkatraman S
2012-11-06 16:52 ` [PATCH 3/5] mmc: omap_hsmmc: introduce omap_hsmmc_prepare/complete Venkatraman S
2012-11-06 16:52 ` [PATCH 4/5] mmc: omap_hsmmc: cleanup the bitmap definitions of Interrupt Register Venkatraman S
2012-11-07 13:24   ` Balaji T K
2012-11-08  8:57     ` Venkatraman S
2012-11-06 16:52 ` [PATCH 5/5] mmc: omap_hsmmc: convert critical failure reports to dev_err Venkatraman S
2012-11-18  1:09 ` [PATCH 0/5] mmc: omap_hsmmc: Few patches for omap_hsmmc Chris Ball
2012-11-19 16:27   ` Venkatraman S

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=509D25C8.5010609@ti.com \
    --to=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=svenkatr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.