lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Sep 2008 15:59:59 -0500
From:	Timur Tabi <timur@...escale.com>
To:	Dan Williams <dan.j.williams@...el.com>
CC:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>, leoli@...escale.com
Subject: Re: [PATCH] fsl-dma: allow Freescale Elo DMA driver to be compiled
 as a module

Dan Williams wrote:

> The last three hunks should be broken out into a separate 'fix' patch
> with its own changelog.

Can you be more specific?  I can see how "return 0" -> "return -ENOMEM" could be
separated out, but the Kconfig hunk is integral to the patch, and the "if
(fsl_chan->desc_pool) return 1;" is needed to prevent a memory leak if the
module is unloaded.

>> -static __init int of_fsl_dma_chan_init(void)
>> +static void fsl_dma_chan_remove(struct fsl_dma_chan *fchan)
>>  {
>> -       return of_register_platform_driver(&of_fsl_dma_chan_driver);
>> +       if (fchan) {
>> +               of_device_unregister(fchan->of_dev);
>> +
>> +               free_irq(fchan->irq, fchan);
>> +               list_del(&fchan->common.device_node);
>> +               iounmap(fchan->reg_base);
>> +               kfree(fchan);
>> +       }
>>  }
> 
> removing a NULL fchan should be an error right?  

No, this is a side-effect of not using a linked-list to store the channels found
by the driver.  The driver has a 4-element array to store the channel info.
Normally, all four channels are defined in the OF device tree, so all four
elements are defined.  But it's not a requirement, so in those cases, the
non-defined channels will have NULL for fchan.

I have plans to replace the array with a linked list.  This change will fix a
few other minor problems with the driver.

> Perhaps move the
> check up to of_fsl_dma_remove().

I can do that.

-- 
Timur Tabi
Linux kernel developer at Freescale
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ