<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/uio, branch v4.10</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>uio-hv-generic: store physical addresses instead of virtual</title>
<updated>2016-12-10T13:57:58+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-12-09T11:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=190cc65e912de7e8f7ebddcecfbf55a610281a8c'/>
<id>190cc65e912de7e8f7ebddcecfbf55a610281a8c</id>
<content type='text'>
gcc warns about the newly added driver when phys_addr_t is wider than
a pointer:

drivers/uio/uio_hv_generic.c: In function 'hv_uio_mmap':
drivers/uio/uio_hv_generic.c:71:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
    virt_to_phys((void *)info-&gt;mem[mi].addr) &gt;&gt; PAGE_SHIFT,
drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
drivers/uio/uio_hv_generic.c:140:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   = (phys_addr_t)dev-&gt;channel-&gt;ringbuffer_pages;
drivers/uio/uio_hv_generic.c:147:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   (phys_addr_t)vmbus_connection.int_page;
drivers/uio/uio_hv_generic.c:153:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   (phys_addr_t)vmbus_connection.monitor_pages[1];

I can't see why we store a virtual address in a phys_addr_t here,
as the only user of that variable converts it into a physical
address anyway, so this moves the conversion to where it logically
fits according to the types.

Fixes: 95096f2fbd10 ("uio-hv-generic: new userspace i/o driver for VMBus")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc warns about the newly added driver when phys_addr_t is wider than
a pointer:

drivers/uio/uio_hv_generic.c: In function 'hv_uio_mmap':
drivers/uio/uio_hv_generic.c:71:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
    virt_to_phys((void *)info-&gt;mem[mi].addr) &gt;&gt; PAGE_SHIFT,
drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
drivers/uio/uio_hv_generic.c:140:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   = (phys_addr_t)dev-&gt;channel-&gt;ringbuffer_pages;
drivers/uio/uio_hv_generic.c:147:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   (phys_addr_t)vmbus_connection.int_page;
drivers/uio/uio_hv_generic.c:153:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   (phys_addr_t)vmbus_connection.monitor_pages[1];

I can't see why we store a virtual address in a phys_addr_t here,
as the only user of that variable converts it into a physical
address anyway, so this moves the conversion to where it logically
fits according to the types.

Fixes: 95096f2fbd10 ("uio-hv-generic: new userspace i/o driver for VMBus")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio-hv-generic: new userspace i/o driver for VMBus</title>
<updated>2016-12-06T10:52:49+00:00</updated>
<author>
<name>Stephen Hemminger</name>
<email>sthemmin@microsoft.com</email>
</author>
<published>2016-12-03T20:34:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95096f2fbd10186d3e78a328b327afc71428f65f'/>
<id>95096f2fbd10186d3e78a328b327afc71428f65f</id>
<content type='text'>
This is a new driver to enable userspace networking on VMBus.
It is based largely on the similar driver that already exists
for PCI, and earlier work done by Brocade to support DPDK.

Signed-off-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Signed-off-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a new driver to enable userspace networking on VMBus.
It is based largely on the similar driver that already exists
for PCI, and earlier work done by Brocade to support DPDK.

Signed-off-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Signed-off-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: pruss: add clk_disable()</title>
<updated>2016-11-29T19:43:12+00:00</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2016-11-25T21:55:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e663c5dbad2999aa824045c8e01fed459d1fc833'/>
<id>e663c5dbad2999aa824045c8e01fed459d1fc833</id>
<content type='text'>
pruss_probe() enables gdev-&gt;pruss_clk, but there is no clk_disable()
in the driver.

The patch adds clk_disable() to pruss_cleanup() and error handling for
clk_enable().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pruss_probe() enables gdev-&gt;pruss_clk, but there is no clk_disable()
in the driver.

The patch adds clk_disable() to pruss_cleanup() and error handling for
clk_enable().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: fix dmem_region_start computation</title>
<updated>2016-08-31T11:07:30+00:00</updated>
<author>
<name>Jan Viktorin</name>
<email>viktorin@rehivetech.com</email>
</author>
<published>2016-05-17T09:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d31a2588ae37a5d0f61f4d956454e9504846aeb'/>
<id>4d31a2588ae37a5d0f61f4d956454e9504846aeb</id>
<content type='text'>
The variable i contains a total number of resources (including
IORESOURCE_IRQ). However, we want the dmem_region_start to point
after the last resource of type IORESOURCE_MEM. The original behaviour
leads (very likely) to skipping several UIO mapping regions and makes
them useless. Fix this by computing dmem_region_start from the uiomem
which points to the last used UIO mapping.

Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation")

Signed-off-by: Jan Viktorin &lt;viktorin@rehivetech.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable i contains a total number of resources (including
IORESOURCE_IRQ). However, we want the dmem_region_start to point
after the last resource of type IORESOURCE_MEM. The original behaviour
leads (very likely) to skipping several UIO mapping regions and makes
them useless. Fix this by computing dmem_region_start from the uiomem
which points to the last used UIO mapping.

Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation")

Signed-off-by: Jan Viktorin &lt;viktorin@rehivetech.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: add missing error codes</title>
<updated>2016-05-01T21:11:12+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-04-01T11:04:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0320a278b9ef80cfa44f74b7f9bb36781695f3ee'/>
<id>0320a278b9ef80cfa44f74b7f9bb36781695f3ee</id>
<content type='text'>
My static checker complains that "ret" could be uninitialized at the
end, which is true but it's more likely that it would be set to zero.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
My static checker complains that "ret" could be uninitialized at the
end, which is true but it's more likely that it would be set to zero.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: fix false positive __might_sleep warning splat</title>
<updated>2015-10-04T11:32:25+00:00</updated>
<author>
<name>Michal Hocko</name>
<email>mhocko@suse.com</email>
</author>
<published>2015-09-07T07:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edce5e6f33a365c879b453286191bf397cc5efb4'/>
<id>edce5e6f33a365c879b453286191bf397cc5efb4</id>
<content type='text'>
Andy has reported a __might_sleep warning
[ 5174.883617] WARNING: CPU: 0 PID: 1532 at
/home/agrover/git/kernel/kernel/sched/core.c:7389 __might_sleep+0x7d/0x90()
[ 5174.884407] do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;ffffffffa02a5821&gt;] uio_read+0x91/0x170 [uio]
[ 5174.885198] Modules linked in: tcm_loop target_core_user uio target_core_pscsi target_core_file target_core_iblock iscsi_target_mod  target_core_mod uinput fuse nfsv3 nfs_acl nfs lockd grace fscache sunrpc microcode i2c_piix4 virtio_balloon i2c_core xfs libcrc32c crc32c_intel  virtio_net virtio_blk
[ 5174.887351] CPU: 0 PID: 1532 Comm: tcmu-runner Not tainted 4.2.0-rc7+
[ 5174.887853] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.8.1-20150318_183358- 04/01/2014
[ 5174.888633]  ffffffff81a3b870 ffff880045393ca8 ffffffff817afaae
0000000000000000
[ 5174.889224]  ffff880045393cf8 ffff880045393ce8 ffffffff8109a846
ffff880045393cd8
[ 5174.889793]  ffffffffa02a7150 00000000000002dc 0000000000000000
ffff880045008000
[ 5174.890375] Call Trace:
[ 5174.890562]  [&lt;ffffffff817afaae&gt;] dump_stack+0x4c/0x65
[ 5174.890938]  [&lt;ffffffff8109a846&gt;] warn_slowpath_common+0x86/0xc0
[ 5174.891388]  [&lt;ffffffff8109a8c6&gt;] warn_slowpath_fmt+0x46/0x50
[ 5174.891808]  [&lt;ffffffffa02a5821&gt;] ? uio_read+0x91/0x170 [uio]
[ 5174.892237]  [&lt;ffffffffa02a5821&gt;] ? uio_read+0x91/0x170 [uio]
[ 5174.892653]  [&lt;ffffffff810c584d&gt;] __might_sleep+0x7d/0x90
[ 5174.893055]  [&lt;ffffffff811ea023&gt;] __might_fault+0x43/0xa0
[ 5174.893448]  [&lt;ffffffff817b31ce&gt;] ? schedule+0x3e/0x90
[ 5174.893820]  [&lt;ffffffffa02a58c2&gt;] uio_read+0x132/0x170 [uio]
[ 5174.894240]  [&lt;ffffffff810cbb80&gt;] ? wake_up_q+0x70/0x70
[ 5174.894620]  [&lt;ffffffff81236168&gt;] __vfs_read+0x28/0xe0
[ 5174.894993]  [&lt;ffffffff81353233&gt;] ? security_file_permission+0xa3/0xc0
[ 5174.895541]  [&lt;ffffffff8123678f&gt;] ? rw_verify_area+0x4f/0xf0
[ 5174.896006]  [&lt;ffffffff812368ba&gt;] vfs_read+0x8a/0x140
[ 5174.896391]  [&lt;ffffffff817b28f5&gt;] ? __schedule+0x425/0xcc0
[ 5174.896788]  [&lt;ffffffff812375d9&gt;] SyS_read+0x49/0xb0

The warning is a false positive because uio_read doesn't depent on
TASK_INTERRUPTIBLE after copy_to_user so it is safe to silence the
warning by an explicit setting the state to TASK_RUNNING in the path
which might call into TASK_RUNNING.

Reported-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Andy has reported a __might_sleep warning
[ 5174.883617] WARNING: CPU: 0 PID: 1532 at
/home/agrover/git/kernel/kernel/sched/core.c:7389 __might_sleep+0x7d/0x90()
[ 5174.884407] do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;ffffffffa02a5821&gt;] uio_read+0x91/0x170 [uio]
[ 5174.885198] Modules linked in: tcm_loop target_core_user uio target_core_pscsi target_core_file target_core_iblock iscsi_target_mod  target_core_mod uinput fuse nfsv3 nfs_acl nfs lockd grace fscache sunrpc microcode i2c_piix4 virtio_balloon i2c_core xfs libcrc32c crc32c_intel  virtio_net virtio_blk
[ 5174.887351] CPU: 0 PID: 1532 Comm: tcmu-runner Not tainted 4.2.0-rc7+
[ 5174.887853] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.8.1-20150318_183358- 04/01/2014
[ 5174.888633]  ffffffff81a3b870 ffff880045393ca8 ffffffff817afaae
0000000000000000
[ 5174.889224]  ffff880045393cf8 ffff880045393ce8 ffffffff8109a846
ffff880045393cd8
[ 5174.889793]  ffffffffa02a7150 00000000000002dc 0000000000000000
ffff880045008000
[ 5174.890375] Call Trace:
[ 5174.890562]  [&lt;ffffffff817afaae&gt;] dump_stack+0x4c/0x65
[ 5174.890938]  [&lt;ffffffff8109a846&gt;] warn_slowpath_common+0x86/0xc0
[ 5174.891388]  [&lt;ffffffff8109a8c6&gt;] warn_slowpath_fmt+0x46/0x50
[ 5174.891808]  [&lt;ffffffffa02a5821&gt;] ? uio_read+0x91/0x170 [uio]
[ 5174.892237]  [&lt;ffffffffa02a5821&gt;] ? uio_read+0x91/0x170 [uio]
[ 5174.892653]  [&lt;ffffffff810c584d&gt;] __might_sleep+0x7d/0x90
[ 5174.893055]  [&lt;ffffffff811ea023&gt;] __might_fault+0x43/0xa0
[ 5174.893448]  [&lt;ffffffff817b31ce&gt;] ? schedule+0x3e/0x90
[ 5174.893820]  [&lt;ffffffffa02a58c2&gt;] uio_read+0x132/0x170 [uio]
[ 5174.894240]  [&lt;ffffffff810cbb80&gt;] ? wake_up_q+0x70/0x70
[ 5174.894620]  [&lt;ffffffff81236168&gt;] __vfs_read+0x28/0xe0
[ 5174.894993]  [&lt;ffffffff81353233&gt;] ? security_file_permission+0xa3/0xc0
[ 5174.895541]  [&lt;ffffffff8123678f&gt;] ? rw_verify_area+0x4f/0xf0
[ 5174.896006]  [&lt;ffffffff812368ba&gt;] vfs_read+0x8a/0x140
[ 5174.896391]  [&lt;ffffffff817b28f5&gt;] ? __schedule+0x425/0xcc0
[ 5174.896788]  [&lt;ffffffff812375d9&gt;] SyS_read+0x49/0xb0

The warning is a false positive because uio_read doesn't depent on
TASK_INTERRUPTIBLE after copy_to_user so it is safe to silence the
warning by an explicit setting the state to TASK_RUNNING in the path
which might call into TASK_RUNNING.

Reported-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: uio_fsl_elbc_gpcm: Fix module autoload for OF platform driver</title>
<updated>2015-10-04T11:32:25+00:00</updated>
<author>
<name>Luis de Bethencourt</name>
<email>luis@debethencourt.com</email>
</author>
<published>2015-09-03T11:08:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0049ef9c8d44e46d042e463fb74e120efe7640f2'/>
<id>0049ef9c8d44e46d042e463fb74e120efe7640f2</id>
<content type='text'>
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt &lt;luis@debethencourt.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt &lt;luis@debethencourt.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: UIO_PRUSS should depend on HAS_DMA</title>
<updated>2015-08-05T20:25:59+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2015-06-29T07:12:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=686079c9b71a4673d0068ea4538f22359070ee33'/>
<id>686079c9b71a4673d0068ea4538f22359070ee33</id>
<content type='text'>
If NO_DMA=y:

    ERROR: "dma_alloc_coherent" [drivers/uio/uio_pruss.ko] undefined!
    ERROR: "dma_free_coherent" [drivers/uio/uio_pruss.ko] undefined!

Add a dependency on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If NO_DMA=y:

    ERROR: "dma_alloc_coherent" [drivers/uio/uio_pruss.ko] undefined!
    ERROR: "dma_free_coherent" [drivers/uio/uio_pruss.ko] undefined!

Add a dependency on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: uio_fsl_elbc_gpcm: Use module_platform_driver</title>
<updated>2015-08-05T20:25:59+00:00</updated>
<author>
<name>Vaishali Thakkar</name>
<email>vthakkar1994@gmail.com</email>
</author>
<published>2015-07-08T04:54:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d12f569c9b57ecdb18631d0b54c5224da5a1c233'/>
<id>d12f569c9b57ecdb18631d0b54c5224da5a1c233</id>
<content type='text'>
Use module_platform_driver for drivers whose init and exit functions
only register and unregister, respectively.

A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:

@a@
identifier f, x;
@@
-static f(...) { return platform_driver_register(&amp;x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { platform_driver_unregister(&amp;x); }

@c depends on a &amp;&amp; b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a &amp;&amp; b &amp;&amp; c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_platform_driver;
@@
-module_exit(e);
+module_platform_driver(x);

Signed-off-by: Vaishali Thakkar &lt;vthakkar1994@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use module_platform_driver for drivers whose init and exit functions
only register and unregister, respectively.

A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:

@a@
identifier f, x;
@@
-static f(...) { return platform_driver_register(&amp;x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { platform_driver_unregister(&amp;x); }

@c depends on a &amp;&amp; b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a &amp;&amp; b &amp;&amp; c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_platform_driver;
@@
-module_exit(e);
+module_platform_driver(x);

Signed-off-by: Vaishali Thakkar &lt;vthakkar1994@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uio: Destroy uio_idr on module exit</title>
<updated>2015-08-05T20:25:59+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2015-07-08T15:24:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e2ef93930326134001523016782daddf1a4b78a2'/>
<id>e2ef93930326134001523016782daddf1a4b78a2</id>
<content type='text'>
Destroy uio_idr on module exit, reclaiming the allocated memory.

This was detected by the following semantic patch (written by Luis Rodriguez
&lt;mcgrof@suse.com&gt;)
&lt;SmPL&gt;
@ defines_module_init @
declarer name module_init, module_exit;
declarer name DEFINE_IDR;
identifier init;
@@

module_init(init);

@ defines_module_exit @
identifier exit;
@@

module_exit(exit);

@ declares_idr depends on defines_module_init &amp;&amp; defines_module_exit @
identifier idr;
@@

DEFINE_IDR(idr);

@ on_exit_calls_destroy depends on declares_idr &amp;&amp; defines_module_exit @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 idr_destroy(&amp;idr);
 ...
}

@ missing_module_idr_destroy depends on declares_idr &amp;&amp; defines_module_exit &amp;&amp; !on_exit_calls_destroy @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 +idr_destroy(&amp;idr);
}

&lt;/SmPL&gt;

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Destroy uio_idr on module exit, reclaiming the allocated memory.

This was detected by the following semantic patch (written by Luis Rodriguez
&lt;mcgrof@suse.com&gt;)
&lt;SmPL&gt;
@ defines_module_init @
declarer name module_init, module_exit;
declarer name DEFINE_IDR;
identifier init;
@@

module_init(init);

@ defines_module_exit @
identifier exit;
@@

module_exit(exit);

@ declares_idr depends on defines_module_init &amp;&amp; defines_module_exit @
identifier idr;
@@

DEFINE_IDR(idr);

@ on_exit_calls_destroy depends on declares_idr &amp;&amp; defines_module_exit @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 idr_destroy(&amp;idr);
 ...
}

@ missing_module_idr_destroy depends on declares_idr &amp;&amp; defines_module_exit &amp;&amp; !on_exit_calls_destroy @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 +idr_destroy(&amp;idr);
}

&lt;/SmPL&gt;

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
