All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: Add missing sg_init_table() call
Date: Fri, 23 Nov 2007 10:18:42 +0100	[thread overview]
Message-ID: <20071123091841.GC2863@kernel.dk> (raw)
In-Reply-To: <1195759971-19825-1-git-send-email-hskinnemoen@atmel.com>

On Thu, Nov 22 2007, Haavard Skinnemoen wrote:
> mmc_init_queue only initializes the scatterlists with sg_init_table()
> when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG
> is set.
> 
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
>  drivers/mmc/card/queue.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 1b9c9b6..30cd13b 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -180,12 +180,13 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
>  		blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
>  		blk_queue_max_segment_size(mq->queue, host->max_seg_size);
>  
> -		mq->sg = kzalloc(sizeof(struct scatterlist) *
> +		mq->sg = kmalloc(sizeof(struct scatterlist) *
>  			host->max_phys_segs, GFP_KERNEL);
>  		if (!mq->sg) {
>  			ret = -ENOMEM;
>  			goto cleanup_queue;
>  		}
> +		sg_init_table(mq->sg, host->max_phys_segs);
>  	}
>  
>  	init_MUTEX(&mq->thread_sem);

Applied

-- 
Jens Axboe


  reply	other threads:[~2007-11-23  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 19:32 [PATCH] mmc: Add missing sg_init_table() call Haavard Skinnemoen
2007-11-23  9:18 ` Jens Axboe [this message]
2007-11-27  5:29 ` Andrew Morton
2007-11-27  5:57   ` Pierre Ossman
2007-11-27  8:54     ` Jens Axboe
2007-11-27 17:27       ` Rafael J. Wysocki
2007-11-27  9:11   ` Haavard Skinnemoen

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=20071123091841.GC2863@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.