<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/input/serio/hp_sdc_mlc.c, branch v3.0.2</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>Input: serio HIL MLC - don't deref null, don't leak and return proper error</title>
<updated>2010-11-20T21:38:18+00:00</updated>
<author>
<name>Jesper Juhl</name>
<email>jj@chaosbits.net</email>
</author>
<published>2010-11-20T21:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=39de52104dd92bc0548a20201350111dc9317df9'/>
<id>39de52104dd92bc0548a20201350111dc9317df9</id>
<content type='text'>
While reviewing various users of kernel memory allocation functions I came
across drivers/input/serio/hil_mlc.c::hil_mlc_register() and noticed that:

 - it calls kzalloc() but fails to check for a NULL return before use.
 - it makes several allocations and if one fails it doesn't free the
   previous ones.
 - It doesn't return -ENOMEM in the failed memory allocation case (it just
   crashes).

This patch corrects all of the above and also reworks the only caller of
this function that I could find
(drivers/input/serio/hp_sdc_mlc.c::hp_sdc_mlc_out()) so that it now checks
the return value of hil_mlc_register() and properly propagates it on
failure and I also restructured the code to remove some labels and goto's
to make it, IMHO nicer to read.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Acked-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While reviewing various users of kernel memory allocation functions I came
across drivers/input/serio/hil_mlc.c::hil_mlc_register() and noticed that:

 - it calls kzalloc() but fails to check for a NULL return before use.
 - it makes several allocations and if one fails it doesn't free the
   previous ones.
 - It doesn't return -ENOMEM in the failed memory allocation case (it just
   crashes).

This patch corrects all of the above and also reworks the only caller of
this function that I could find
(drivers/input/serio/hp_sdc_mlc.c::hp_sdc_mlc_out()) so that it now checks
the return value of hil_mlc_register() and properly propagates it on
failure and I also restructured the code to remove some labels and goto's
to make it, IMHO nicer to read.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Acked-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tree-wide: fix assorted typos all over the place</title>
<updated>2009-12-04T14:39:55+00:00</updated>
<author>
<name>André Goddard Rosa</name>
<email>andre.goddard@gmail.com</email>
</author>
<published>2009-11-14T15:09:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=af901ca181d92aac3a7dc265144a9081a86d8f39'/>
<id>af901ca181d92aac3a7dc265144a9081a86d8f39</id>
<content type='text'>
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa &lt;andre.goddard@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa &lt;andre.goddard@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: hp_sdc_mlc.c - check return value of down_trylock()</title>
<updated>2009-08-02T13:13:29+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2009-08-02T13:13:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c6fe6b0783a8fd923d11dd0388cbd561ff15bdf1'/>
<id>c6fe6b0783a8fd923d11dd0388cbd561ff15bdf1</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into next</title>
<updated>2008-07-21T04:55:14+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2008-07-21T04:55:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=908cf4b925e419bc74f3297b2f0e51d6f8a81da2'/>
<id>908cf4b925e419bc74f3297b2f0e51d6f8a81da2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: hp_sdc_mlc.c - make a struct static</title>
<updated>2008-06-30T13:38:33+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2008-06-26T14:46:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fa14f7e8df9ee8afea23dab21adb0b7a521f1cd6'/>
<id>fa14f7e8df9ee8afea23dab21adb0b7a521f1cd6</id>
<content type='text'>
This patch makes the needlessly global struct hp_sdc_mlc_priv_s static.

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes the needlessly global struct hp_sdc_mlc_priv_s static.

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>m68k: Some input drivers do not check the platform</title>
<updated>2008-05-18T20:28:49+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2008-05-18T18:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eb98630ba02f6a23a2d202be082757a9e9940b2b'/>
<id>eb98630ba02f6a23a2d202be082757a9e9940b2b</id>
<content type='text'>
Some input drivers do not check whether they're actually running on the
correct platform, causing multi-platform kernels to crash if they are not.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some input drivers do not check whether they're actually running on the
correct platform, causing multi-platform kernels to crash if they are not.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert asm/semaphore.h users to linux/semaphore.h</title>
<updated>2008-04-19T02:22:54+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-04-19T02:21:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6188e10d38b8d7244ee7776d5f1f88c837b4b93f'/>
<id>6188e10d38b8d7244ee7776d5f1f88c837b4b93f</id>
<content type='text'>
Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: HIL - fix rwlock recursion bug</title>
<updated>2007-03-16T04:59:29+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2007-03-16T04:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9575499dfebc0f0fbbf122223f02e9e92630661d'/>
<id>9575499dfebc0f0fbbf122223f02e9e92630661d</id>
<content type='text'>
The following bug happens when insmoding hp_sdc_mlc.ko:

    HP SDC MLC: Registering the System Domain Controller's HIL MLC.
    BUG: rwlock recursion on CPU#0, hotplug/1814, 00854734
    Backtrace:
     [&lt;10267560&gt;] _raw_write_lock+0x50/0x88
     [&lt;10104008&gt;] _write_lock_irqsave+0x14/0x24
     [&lt;008537d4&gt;] hp_sdc_mlc_out+0x38/0x25c [hp_sdc_mlc]
     [&lt;0084ebd8&gt;] hilse_donode+0x308/0x470 [hil_mlc]
     [&lt;0084ed80&gt;] hil_mlcs_process+0x40/0x6c [hil_mlc]
     [&lt;10130f80&gt;] tasklet_action+0x78/0xb8
     [&lt;10130cec&gt;] __do_softirq+0x60/0xcc
     [&lt;1010428c&gt;] __lock_text_end+0x38/0x48
     [&lt;10108348&gt;] do_cpu_irq_mask+0xf0/0x11c
     [&lt;1010b068&gt;] intr_return+0x0/0xc

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following bug happens when insmoding hp_sdc_mlc.ko:

    HP SDC MLC: Registering the System Domain Controller's HIL MLC.
    BUG: rwlock recursion on CPU#0, hotplug/1814, 00854734
    Backtrace:
     [&lt;10267560&gt;] _raw_write_lock+0x50/0x88
     [&lt;10104008&gt;] _write_lock_irqsave+0x14/0x24
     [&lt;008537d4&gt;] hp_sdc_mlc_out+0x38/0x25c [hp_sdc_mlc]
     [&lt;0084ebd8&gt;] hilse_donode+0x308/0x470 [hil_mlc]
     [&lt;0084ed80&gt;] hil_mlcs_process+0x40/0x6c [hil_mlc]
     [&lt;10130f80&gt;] tasklet_action+0x78/0xb8
     [&lt;10130cec&gt;] __do_softirq+0x60/0xcc
     [&lt;1010428c&gt;] __lock_text_end+0x38/0x48
     [&lt;10108348&gt;] do_cpu_irq_mask+0xf0/0x11c
     [&lt;1010b068&gt;] intr_return+0x0/0xc

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: HIL - cleanup coding style</title>
<updated>2007-03-01T04:51:29+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2007-03-01T04:51:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ffd51f46cdf856c0b453d2828a74d552cc15f881'/>
<id>ffd51f46cdf856c0b453d2828a74d552cc15f881</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: HIL - various fixes for HIL drivers</title>
<updated>2007-03-01T04:51:19+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2007-03-01T04:51:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3acaf540a33199141695f2e2fcfa8829053159bf'/>
<id>3acaf540a33199141695f2e2fcfa8829053159bf</id>
<content type='text'>
 - mark some structures const or __read_mostly
 - hilkbd.c: fix uninitialized spinlock in HIL keyboard driver
 - hil_mlc.c: use USEC_PER_SEC instead of 1000000
 - hp_sdc: bugfix for request_irq()/free_irq() parameters, this prevented
           multiple load/unload cycles as module

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - mark some structures const or __read_mostly
 - hilkbd.c: fix uninitialized spinlock in HIL keyboard driver
 - hil_mlc.c: use USEC_PER_SEC instead of 1000000
 - hp_sdc: bugfix for request_irq()/free_irq() parameters, this prevented
           multiple load/unload cycles as module

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
</feed>
