[PATCH 21/23] mci-core: switch to resource

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Aug 1 04:03:01 EDT 2011


On 10:09 Mon 01 Aug     , Sascha Hauer wrote:
> On Mon, Aug 01, 2011 at 09:47:21AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 09:32 Mon 01 Aug     , Sascha Hauer wrote:
> > > On Sat, Jul 30, 2011 at 05:17:09AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > > > ---
> > > >  drivers/mci/mci-core.c |    2 +-
> > > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > > 
> > > > diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> > > > index 3cf364c..c03885b 100644
> > > > --- a/drivers/mci/mci-core.c
> > > > +++ b/drivers/mci/mci-core.c
> > > > @@ -1231,7 +1231,7 @@ static int mci_card_probe(struct device_d *mci_dev)
> > > >  	p->priv = mci_dev;
> > > >  
> > > >  	strcpy(disk_dev->name, "disk");
> > > > -	disk_dev->size = mci->capacity;
> > > > +	disk_dev->resource[0].size = mci->capacity;
> > > >  	disk_dev->platform_data = p;
> > > 
> > > Resources for a device must be allocated. I already fixed this once with
> > > the following. Please do not reintroduce this bug again.
> > > 
> > > (and honestly, this registering of the "disk" device is just a crude way
> > > of passing around data in a void pointer. The real solution for this is
> > > to just add a register_ata_interface() function instead of registering a
> > > device.)
> > agreed I plan to get rid of this but first need to fininsh the map_base frop
> > 
> > but as we drop map_base and size so we need to do like this
> 
> Ok, but please allocate the space for the resource then.
> 
> I thought about using mapping the vector page to the top of the memory
> space. Then we could get proper NULL pointer deref aborts to catch
> things like this.
can we can we do it in a second patch?

Best Regards,
J.



More information about the barebox mailing list