[linux-dvb] inconsistent use of saa7146_pgtable_free?

Oliver Endriss o.endriss at gmx.de
Sun Apr 22 01:21:29 CEST 2007


Jon Burgess wrote:
> I've been looking at the sa7146 page table code and it looks like the
> saa7146_pgtable_free function is used incorrectly in the error cases:
> 
> >from budget-core.c:
> ttpci_budget_init()
> {
> ...
>     budget->grabbing = saa7146_vmalloc_build_pgtable(dev->pci, budget->buffer_size, &budget->pt))
> ...
> err:
> 	i2c_del_adapter(&budget->i2c_adap);
> 
> 	vfree(budget->grabbing);
> }
> 
> vs:
> ttpci_budget_deinit()
> {
> ...
> 	saa7146_pgtable_free(dev->pci, &budget->pt);
> 
> 
> Shouldn't the vfree() above be a call to saa7146_pgtable_free() ?

Good point. Imho the saa7146_pgtable_free() call must be _added_.
For example:

| err:
| 	i2c_del_adapter(&budget->i2c_adap);
|
|	if (budget->grabbing) {
|		saa7146_pgtable_free(dev->pci, &budget->pt);
|		vfree(budget->grabbing);
|	}

> Also in av7110.c:
> av7110_attach()
> {
> ...
>     av7110->grabbing = saa7146_vmalloc_build_pgtable(pdev, length, &av7110->pt);
> ...
> err_saa71466_vfree_4:
> 	if (!av7110->grabbing)
> 		saa7146_pgtable_free(pdev, &av7110->pt);
> ...
> 
> 
> Surely the (!av7110->grabbing) should be (av7110->grabbing) ?

True. And vfree(av7110->grabbing) is missing, too.

You found the problem. Do you want to prepare and submit the patch?
Please don't forget the patch description and Signed-off-by line.

CU
Oliver

-- 
--------------------------------------------------------
VDR Remote Plugin 0.3.9 available at
http://www.escape-edv.de/endriss/vdr/
--------------------------------------------------------




More information about the linux-dvb mailing list