All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	avictor.za@gmail.com, wolfgang.mues@auerswald.de,
	akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/7] mmc: at91_mci: fix pointer errors
Date: Fri, 26 Feb 2010 23:20:46 +0300	[thread overview]
Message-ID: <20100226201934.GG8417@bicker> (raw)
In-Reply-To: <9535dc8dfe4476a0314b9513fb9d37862faa731d.1267209149.git.nicolas.ferre@atmel.com>

On Fri, Feb 26, 2010 at 07:39:29PM +0100, Nicolas Ferre wrote:
> From: Wolfgang Muees <wolfgang.mues@auerswald.de>
> 
> Fixes two pointer errors, one which leads to memory overwrites if used with
> large chunks of data.
> 
> Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/mmc/host/at91_mci.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
> index 63924e0..6835104 100644
> --- a/drivers/mmc/host/at91_mci.c
> +++ b/drivers/mmc/host/at91_mci.c
> @@ -227,11 +227,13 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data
>  			for (index = 0; index < (amount / 4); index++)
>  				*dmabuf++ = swab32(sgbuffer[index]);
>  		} else {
> -			memcpy(dmabuf, sgbuffer, amount);
> -			dmabuf += amount;
> +			char *tmpv = (char *)dmabuf;
> +			memcpy(tmpv, sgbuffer, amount);
> +			tmpv += amount;
> +			dmabuf = (unsigned *)tmpv;
>  		}
>  
> -		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
> +		kunmap_atomic(((void *)sgbuffer)-sg->offset, KM_BIO_SRC_IRQ);

Please put spaces around the minus sign.

	kunmap_atomic(((void *)sgbuffer) - sg->offset, KM_BIO_SRC_IRQ);

regards,
dan carpenter

>  
>  		if (size == 0)
>  			break;
> -- 
> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

WARNING: multiple messages have this Message-ID (diff)
From: error27@gmail.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] mmc: at91_mci: fix pointer errors
Date: Fri, 26 Feb 2010 23:20:46 +0300	[thread overview]
Message-ID: <20100226201934.GG8417@bicker> (raw)
In-Reply-To: <9535dc8dfe4476a0314b9513fb9d37862faa731d.1267209149.git.nicolas.ferre@atmel.com>

On Fri, Feb 26, 2010 at 07:39:29PM +0100, Nicolas Ferre wrote:
> From: Wolfgang Muees <wolfgang.mues@auerswald.de>
> 
> Fixes two pointer errors, one which leads to memory overwrites if used with
> large chunks of data.
> 
> Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/mmc/host/at91_mci.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
> index 63924e0..6835104 100644
> --- a/drivers/mmc/host/at91_mci.c
> +++ b/drivers/mmc/host/at91_mci.c
> @@ -227,11 +227,13 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data
>  			for (index = 0; index < (amount / 4); index++)
>  				*dmabuf++ = swab32(sgbuffer[index]);
>  		} else {
> -			memcpy(dmabuf, sgbuffer, amount);
> -			dmabuf += amount;
> +			char *tmpv = (char *)dmabuf;
> +			memcpy(tmpv, sgbuffer, amount);
> +			tmpv += amount;
> +			dmabuf = (unsigned *)tmpv;
>  		}
>  
> -		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
> +		kunmap_atomic(((void *)sgbuffer)-sg->offset, KM_BIO_SRC_IRQ);

Please put spaces around the minus sign.

	kunmap_atomic(((void *)sgbuffer) - sg->offset, KM_BIO_SRC_IRQ);

regards,
dan carpenter

>  
>  		if (size == 0)
>  			break;
> -- 
> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: akpm@linux-foundation.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, wolfgang.mues@auerswald.de,
	avictor.za@gmail.com
Subject: Re: [PATCH 1/7] mmc: at91_mci: fix pointer errors
Date: Fri, 26 Feb 2010 23:20:46 +0300	[thread overview]
Message-ID: <20100226201934.GG8417@bicker> (raw)
In-Reply-To: <9535dc8dfe4476a0314b9513fb9d37862faa731d.1267209149.git.nicolas.ferre@atmel.com>

On Fri, Feb 26, 2010 at 07:39:29PM +0100, Nicolas Ferre wrote:
> From: Wolfgang Muees <wolfgang.mues@auerswald.de>
> 
> Fixes two pointer errors, one which leads to memory overwrites if used with
> large chunks of data.
> 
> Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/mmc/host/at91_mci.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
> index 63924e0..6835104 100644
> --- a/drivers/mmc/host/at91_mci.c
> +++ b/drivers/mmc/host/at91_mci.c
> @@ -227,11 +227,13 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data
>  			for (index = 0; index < (amount / 4); index++)
>  				*dmabuf++ = swab32(sgbuffer[index]);
>  		} else {
> -			memcpy(dmabuf, sgbuffer, amount);
> -			dmabuf += amount;
> +			char *tmpv = (char *)dmabuf;
> +			memcpy(tmpv, sgbuffer, amount);
> +			tmpv += amount;
> +			dmabuf = (unsigned *)tmpv;
>  		}
>  
> -		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
> +		kunmap_atomic(((void *)sgbuffer)-sg->offset, KM_BIO_SRC_IRQ);

Please put spaces around the minus sign.

	kunmap_atomic(((void *)sgbuffer) - sg->offset, KM_BIO_SRC_IRQ);

regards,
dan carpenter

>  
>  		if (size == 0)
>  			break;
> -- 
> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  parent reply	other threads:[~2010-02-26 20:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 18:39 [PATCH 1/7] mmc: at91_mci: fix pointer errors Nicolas Ferre
2010-03-01 17:44 ` Nicolas Ferre
2010-02-26 18:39 ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 2/7] mmc: at91_mci: fix timeout errors Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 3/7] mmc: at91_mci: use one coherent DMA buffer Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 4/7] mmc: at91_mci: use DMA buffer for read Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-03-02 21:34   ` Andrew Morton
2010-03-02 21:34     ` Andrew Morton
2010-03-03  7:34     ` Wolfgang Mües
2010-03-03  7:34       ` Wolfgang Mües
2010-03-03 14:17     ` [PATCH] mmc: at91_mci: correct kunmap_atomic() Nicolas Ferre
2010-03-03 14:17       ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 5/7] mmc: at91_mci: enable large data blocks Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 6/7] mmc: at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39 ` [PATCH 7/7] mmc: at91_mci: introduce per-mci-revision conditional code Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 18:39   ` Nicolas Ferre
2010-02-26 20:20 ` Dan Carpenter [this message]
2010-02-26 20:20   ` [PATCH 1/7] mmc: at91_mci: fix pointer errors Dan Carpenter
2010-02-26 20:20   ` Dan Carpenter
2010-08-27 19:33 ` Chris Ball
2010-08-27 19:33   ` Chris Ball
2010-08-27 19:34   ` Chris Ball
2010-08-27 19:34     ` Chris Ball
2010-08-30  6:51     ` Wolfgang Mües
2010-08-30  6:51       ` Wolfgang Mües
2010-08-30  6:51       ` Wolfgang Mües
2010-08-29 21:39   ` Ryan Mallon
2010-08-29 21:39     ` Ryan Mallon
2010-08-30  6:56     ` Wolfgang Mües
2010-08-30  6:56       ` Wolfgang Mües
2010-08-30  6:56       ` Wolfgang Mües
2010-08-30  7:05       ` Ryan Mallon
2010-08-30  7:05         ` Ryan Mallon

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=20100226201934.GG8417@bicker \
    --to=error27@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avictor.za@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=wolfgang.mues@auerswald.de \
    /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.