<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/misc, branch v3.10.78</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>mei: bus: fix possible boundaries violation</title>
<updated>2014-11-21T17:22:55+00:00</updated>
<author>
<name>Alexander Usyskin</name>
<email>alexander.usyskin@intel.com</email>
</author>
<published>2014-08-25T13:46:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ba8beb4ca84e22996b0f553248ea52c760afb930'/>
<id>ba8beb4ca84e22996b0f553248ea52c760afb930</id>
<content type='text'>
commit cfda2794b5afe7ce64ee9605c64bef0e56a48125 upstream.

function 'strncpy' will fill whole buffer 'id.name' of fixed size (32)
with string value and will not leave place for NULL-terminator.
Possible buffer boundaries violation in following string operations.
Replace strncpy with strlcpy.

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit cfda2794b5afe7ce64ee9605c64bef0e56a48125 upstream.

function 'strncpy' will fill whole buffer 'id.name' of fixed size (32)
with string value and will not leave place for NULL-terminator.
Possible buffer boundaries violation in following string operations.
Replace strncpy with strlcpy.

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>mei: nfc: fix memory leak in error path</title>
<updated>2014-09-05T23:28:36+00:00</updated>
<author>
<name>Alexander Usyskin</name>
<email>alexander.usyskin@intel.com</email>
</author>
<published>2014-08-12T15:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9fab037c6646f853cc71c0d5c740bd2981c48a2'/>
<id>d9fab037c6646f853cc71c0d5c740bd2981c48a2</id>
<content type='text'>
commit 8e8248b1369c97c7bb6f8bcaee1f05deeabab8ef upstream.

NFC will leak buffer if send failed.
Use single exit point that does the freeing

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit 8e8248b1369c97c7bb6f8bcaee1f05deeabab8ef upstream.

NFC will leak buffer if send failed.
Use single exit point that does the freeing

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: reset client state on queued connect request</title>
<updated>2014-09-05T23:28:36+00:00</updated>
<author>
<name>Alexander Usyskin</name>
<email>alexander.usyskin@intel.com</email>
</author>
<published>2014-08-12T15:07:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5935bef5cd35378a1e58333b6472b687c1a8b9cb'/>
<id>5935bef5cd35378a1e58333b6472b687c1a8b9cb</id>
<content type='text'>
commit 73ab4232388b7a08f17c8d08141ff2099fa0b161 upstream.

If connect request is queued (e.g. device in pg) set client state
to initializing, thus avoid preliminary exit in wait if current
state is disconnected.

This is regression from:

commit e4d8270e604c3202131bac607969605ac397b893
Author: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
mei: set connecting state just upon connection request is sent to the fw

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit 73ab4232388b7a08f17c8d08141ff2099fa0b161 upstream.

If connect request is queued (e.g. device in pg) set client state
to initializing, thus avoid preliminary exit in wait if current
state is disconnected.

This is regression from:

commit e4d8270e604c3202131bac607969605ac397b893
Author: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
mei: set connecting state just upon connection request is sent to the fw

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: start disconnect request timer consistently</title>
<updated>2014-09-05T23:28:34+00:00</updated>
<author>
<name>Alexander Usyskin</name>
<email>alexander.usyskin@intel.com</email>
</author>
<published>2014-07-17T07:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2cffa7238a408b7ff5ce9a4352485ff035fb7b19'/>
<id>2cffa7238a408b7ff5ce9a4352485ff035fb7b19</id>
<content type='text'>
commit 22b987a325701223f9a37db700c6eb20b9924c6f upstream.

Link must be reset in case the fw doesn't
respond to client disconnect request.
We did charge the timer only in irq path
from mei_cl_irq_close and not in mei_cl_disconnect

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit 22b987a325701223f9a37db700c6eb20b9924c6f upstream.

Link must be reset in case the fw doesn't
respond to client disconnect request.
We did charge the timer only in irq path
from mei_cl_irq_close and not in mei_cl_disconnect

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: me: fix hw ready reset flow</title>
<updated>2014-07-07T01:54:15+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2014-05-12T09:19:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d285df86a113f160ed1b48f2c63056a3d6c2219f'/>
<id>d285df86a113f160ed1b48f2c63056a3d6c2219f</id>
<content type='text'>
commit b04ada92ffaabb868497a1fce8e4f6bf74e5488f upstream.

We cleared H_RST for H_CSR on spurious interrupt generated when ME_RDY
while cleared and not while  ME_RDY is set. The spurious interrupt
is not delivered on all platforms in this case the
driver may fail to initialize.

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.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>
commit b04ada92ffaabb868497a1fce8e4f6bf74e5488f upstream.

We cleared H_RST for H_CSR on spurious interrupt generated when ME_RDY
while cleared and not while  ME_RDY is set. The spurious interrupt
is not delivered on all platforms in this case the
driver may fail to initialize.

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: me: read H_CSR after asserting reset</title>
<updated>2014-07-07T01:54:15+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2014-05-12T09:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=83a03fda3d14ba6c097f0f4cdd86a8b9d9ed633a'/>
<id>83a03fda3d14ba6c097f0f4cdd86a8b9d9ed633a</id>
<content type='text'>
commit c40765d919d25d2d44d99c4ce39e48808f137e1e upstream.

According the spec the host should read H_CSR again
after asserting reset H_RST to ensure that reset was
read by the firmware

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.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>
commit c40765d919d25d2d44d99c4ce39e48808f137e1e upstream.

According the spec the host should read H_CSR again
after asserting reset H_RST to ensure that reset was
read by the firmware

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: me: drop harmful wait optimization</title>
<updated>2014-06-16T20:42:54+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2014-05-12T09:19:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=310c6221b98ef56a77793c6c293b871898e1d9dc'/>
<id>310c6221b98ef56a77793c6c293b871898e1d9dc</id>
<content type='text'>
commit 07cd7be3d92eeeae1f92a017f2cfe4fdd9256526 upstream.

It my take time till ME_RDY will be cleared after the reset,
so we cannot check the bit before we got the interrupt

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.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>
commit 07cd7be3d92eeeae1f92a017f2cfe4fdd9256526 upstream.

It my take time till ME_RDY will be cleared after the reset,
so we cannot check the bit before we got the interrupt

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: me: do not load the driver if the FW doesn't support MEI interface</title>
<updated>2014-05-06T14:55:27+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2014-03-25T19:25:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8343a52ace5428678b689273fe0c2298f7a9e2a9'/>
<id>8343a52ace5428678b689273fe0c2298f7a9e2a9</id>
<content type='text'>
commit 5e6533a6f52f1a8283b2f818f5828be99a417dd6 upstream.

NM and SPS  FW types that may run on ME device on server platforms
do not have valid MEI/HECI interface and driver should not
be bound to it as this might lead to system hung.
In practice not all BIOSes effectively hide such devices from the
OS and in some cases it is not possible.

We determine FW type by examining Host FW status registers in order to
unbind the driver.
In this patch we are adding check for ME on Cougar Point, Lynx Point
Devices

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Tested-by: Nikola Ciprich &lt;nikola.ciprich@linuxbox.cz&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>
commit 5e6533a6f52f1a8283b2f818f5828be99a417dd6 upstream.

NM and SPS  FW types that may run on ME device on server platforms
do not have valid MEI/HECI interface and driver should not
be bound to it as this might lead to system hung.
In practice not all BIOSes effectively hide such devices from the
OS and in some cases it is not possible.

We determine FW type by examining Host FW status registers in order to
unbind the driver.
In this patch we are adding check for ME on Cougar Point, Lynx Point
Devices

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Tested-by: Nikola Ciprich &lt;nikola.ciprich@linuxbox.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: set client's read_cb to NULL when flow control fails</title>
<updated>2014-03-07T05:30:10+00:00</updated>
<author>
<name>Chao Bi</name>
<email>chao.bi@intel.com</email>
</author>
<published>2014-02-12T19:27:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2bc744aa8bb9eaff8facd237c359cf64bf6ec239'/>
<id>2bc744aa8bb9eaff8facd237c359cf64bf6ec239</id>
<content type='text'>
commit accb884b32e82f943340688c9cd30290531e73e0 upstream.

In mei_cl_read_start(), if it fails to send flow control request, it
will release "cl-&gt;read_cb" but forget to set pointer to NULL, leaving
"cl-&gt;read_cb" still pointing to random memory, next time this client is
operated like mei_release(), it has chance to refer to this wrong pointer.

Fixes:  PANIC at kfree in mei_release()

[228781.826904] Call Trace:
[228781.829737]  [&lt;c16249b8&gt;] ? mei_cl_unlink+0x48/0xa0
[228781.835283]  [&lt;c1624487&gt;] mei_io_cb_free+0x17/0x30
[228781.840733]  [&lt;c16265d8&gt;] mei_release+0xa8/0x180
[228781.845989]  [&lt;c135c610&gt;] ? __fsnotify_parent+0xa0/0xf0
[228781.851925]  [&lt;c1325a69&gt;] __fput+0xd9/0x200
[228781.856696]  [&lt;c1325b9d&gt;] ____fput+0xd/0x10
[228781.861467]  [&lt;c125cae1&gt;] task_work_run+0x81/0xb0
[228781.866821]  [&lt;c1242e53&gt;] do_exit+0x283/0xa00
[228781.871786]  [&lt;c1a82b36&gt;] ? kprobe_flush_task+0x66/0xc0
[228781.877722]  [&lt;c124eeb8&gt;] ? __dequeue_signal+0x18/0x1a0
[228781.883657]  [&lt;c124f072&gt;] ? dequeue_signal+0x32/0x190
[228781.889397]  [&lt;c1243744&gt;] do_group_exit+0x34/0xa0
[228781.894750]  [&lt;c12517b6&gt;] get_signal_to_deliver+0x206/0x610
[228781.901075]  [&lt;c12018d8&gt;] do_signal+0x38/0x100
[228781.906136]  [&lt;c1626d1c&gt;] ? mei_read+0x42c/0x4e0
[228781.911393]  [&lt;c12600a0&gt;] ? wake_up_bit+0x30/0x30
[228781.916745]  [&lt;c16268f0&gt;] ? mei_poll+0x120/0x120
[228781.922001]  [&lt;c1324be9&gt;] ? vfs_read+0x89/0x160
[228781.927158]  [&lt;c16268f0&gt;] ? mei_poll+0x120/0x120
[228781.932414]  [&lt;c133ca34&gt;] ? fget_light+0x44/0xe0
[228781.937670]  [&lt;c1324e58&gt;] ? SyS_read+0x68/0x80
[228781.942730]  [&lt;c12019f5&gt;] do_notify_resume+0x55/0x70
[228781.948376]  [&lt;c1a7de5d&gt;] work_notifysig+0x29/0x30
[228781.953827]  [&lt;c1a70000&gt;] ? bad_area+0x5/0x3e

Signed-off-by: Chao Bi &lt;chao.bi@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit accb884b32e82f943340688c9cd30290531e73e0 upstream.

In mei_cl_read_start(), if it fails to send flow control request, it
will release "cl-&gt;read_cb" but forget to set pointer to NULL, leaving
"cl-&gt;read_cb" still pointing to random memory, next time this client is
operated like mei_release(), it has chance to refer to this wrong pointer.

Fixes:  PANIC at kfree in mei_release()

[228781.826904] Call Trace:
[228781.829737]  [&lt;c16249b8&gt;] ? mei_cl_unlink+0x48/0xa0
[228781.835283]  [&lt;c1624487&gt;] mei_io_cb_free+0x17/0x30
[228781.840733]  [&lt;c16265d8&gt;] mei_release+0xa8/0x180
[228781.845989]  [&lt;c135c610&gt;] ? __fsnotify_parent+0xa0/0xf0
[228781.851925]  [&lt;c1325a69&gt;] __fput+0xd9/0x200
[228781.856696]  [&lt;c1325b9d&gt;] ____fput+0xd/0x10
[228781.861467]  [&lt;c125cae1&gt;] task_work_run+0x81/0xb0
[228781.866821]  [&lt;c1242e53&gt;] do_exit+0x283/0xa00
[228781.871786]  [&lt;c1a82b36&gt;] ? kprobe_flush_task+0x66/0xc0
[228781.877722]  [&lt;c124eeb8&gt;] ? __dequeue_signal+0x18/0x1a0
[228781.883657]  [&lt;c124f072&gt;] ? dequeue_signal+0x32/0x190
[228781.889397]  [&lt;c1243744&gt;] do_group_exit+0x34/0xa0
[228781.894750]  [&lt;c12517b6&gt;] get_signal_to_deliver+0x206/0x610
[228781.901075]  [&lt;c12018d8&gt;] do_signal+0x38/0x100
[228781.906136]  [&lt;c1626d1c&gt;] ? mei_read+0x42c/0x4e0
[228781.911393]  [&lt;c12600a0&gt;] ? wake_up_bit+0x30/0x30
[228781.916745]  [&lt;c16268f0&gt;] ? mei_poll+0x120/0x120
[228781.922001]  [&lt;c1324be9&gt;] ? vfs_read+0x89/0x160
[228781.927158]  [&lt;c16268f0&gt;] ? mei_poll+0x120/0x120
[228781.932414]  [&lt;c133ca34&gt;] ? fget_light+0x44/0xe0
[228781.937670]  [&lt;c1324e58&gt;] ? SyS_read+0x68/0x80
[228781.942730]  [&lt;c12019f5&gt;] do_notify_resume+0x55/0x70
[228781.948376]  [&lt;c1a7de5d&gt;] work_notifysig+0x29/0x30
[228781.953827]  [&lt;c1a70000&gt;] ? bad_area+0x5/0x3e

Signed-off-by: Chao Bi &lt;chao.bi@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mei: don't unset read cb ptr on reset</title>
<updated>2014-02-22T20:41:28+00:00</updated>
<author>
<name>Alexander Usyskin</name>
<email>alexander.usyskin@intel.com</email>
</author>
<published>2014-01-27T20:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=24a509100434799c6ba7d92e9cc37c5ba53fafaf'/>
<id>24a509100434799c6ba7d92e9cc37c5ba53fafaf</id>
<content type='text'>
commit 5cb906c7035f03a3a44fecece9d3ff8fcc75d6e0 upstream.

Don't set read callback to NULL during reset as
this leads to memory leak of both cb and its buffer.
The memory is correctly freed during mei_release.

The memory leak is detectable by kmemleak if
application has open read call while system is going through
suspend/resume.

unreferenced object 0xecead780 (size 64):
  comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
  hex dump (first 32 bytes):
    00 01 10 00 00 02 20 00 00 bf 30 f1 00 00 00 00  ...... ...0.....
    00 00 00 00 00 00 00 00 36 01 00 00 00 70 da e2  ........6....p..
  backtrace:
    [&lt;c1a60aec&gt;] kmemleak_alloc+0x3c/0xa0
    [&lt;c131ed56&gt;] kmem_cache_alloc_trace+0xc6/0x190
    [&lt;c16243c9&gt;] mei_io_cb_init+0x29/0x50
    [&lt;c1625722&gt;] mei_cl_read_start+0x102/0x360
    [&lt;c16268f3&gt;] mei_read+0x103/0x4e0
    [&lt;c1324b09&gt;] vfs_read+0x89/0x160
    [&lt;c1324d5f&gt;] SyS_read+0x4f/0x80
    [&lt;c1a7b318&gt;] syscall_call+0x7/0xb
    [&lt;ffffffff&gt;] 0xffffffff
unreferenced object 0xe2da7000 (size 512):
  comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
  hex dump (first 32 bytes):
    00 6c da e2 7c 00 00 00 00 00 00 00 c0 eb 0c 59  .l..|..........Y
    1b 00 00 00 01 00 00 00 02 10 00 00 01 00 00 00  ................
  backtrace:
    [&lt;c1a60aec&gt;] kmemleak_alloc+0x3c/0xa0
    [&lt;c131f127&gt;] __kmalloc+0xe7/0x1d0
    [&lt;c162447e&gt;] mei_io_cb_alloc_resp_buf+0x2e/0x60
    [&lt;c162574c&gt;] mei_cl_read_start+0x12c/0x360
    [&lt;c16268f3&gt;] mei_read+0x103/0x4e0
    [&lt;c1324b09&gt;] vfs_read+0x89/0x160
    [&lt;c1324d5f&gt;] SyS_read+0x4f/0x80
    [&lt;c1a7b318&gt;] syscall_call+0x7/0xb
    [&lt;ffffffff&gt;] 0xffffffff

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.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>
commit 5cb906c7035f03a3a44fecece9d3ff8fcc75d6e0 upstream.

Don't set read callback to NULL during reset as
this leads to memory leak of both cb and its buffer.
The memory is correctly freed during mei_release.

The memory leak is detectable by kmemleak if
application has open read call while system is going through
suspend/resume.

unreferenced object 0xecead780 (size 64):
  comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
  hex dump (first 32 bytes):
    00 01 10 00 00 02 20 00 00 bf 30 f1 00 00 00 00  ...... ...0.....
    00 00 00 00 00 00 00 00 36 01 00 00 00 70 da e2  ........6....p..
  backtrace:
    [&lt;c1a60aec&gt;] kmemleak_alloc+0x3c/0xa0
    [&lt;c131ed56&gt;] kmem_cache_alloc_trace+0xc6/0x190
    [&lt;c16243c9&gt;] mei_io_cb_init+0x29/0x50
    [&lt;c1625722&gt;] mei_cl_read_start+0x102/0x360
    [&lt;c16268f3&gt;] mei_read+0x103/0x4e0
    [&lt;c1324b09&gt;] vfs_read+0x89/0x160
    [&lt;c1324d5f&gt;] SyS_read+0x4f/0x80
    [&lt;c1a7b318&gt;] syscall_call+0x7/0xb
    [&lt;ffffffff&gt;] 0xffffffff
unreferenced object 0xe2da7000 (size 512):
  comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
  hex dump (first 32 bytes):
    00 6c da e2 7c 00 00 00 00 00 00 00 c0 eb 0c 59  .l..|..........Y
    1b 00 00 00 01 00 00 00 02 10 00 00 01 00 00 00  ................
  backtrace:
    [&lt;c1a60aec&gt;] kmemleak_alloc+0x3c/0xa0
    [&lt;c131f127&gt;] __kmalloc+0xe7/0x1d0
    [&lt;c162447e&gt;] mei_io_cb_alloc_resp_buf+0x2e/0x60
    [&lt;c162574c&gt;] mei_cl_read_start+0x12c/0x360
    [&lt;c16268f3&gt;] mei_read+0x103/0x4e0
    [&lt;c1324b09&gt;] vfs_read+0x89/0x160
    [&lt;c1324d5f&gt;] SyS_read+0x4f/0x80
    [&lt;c1a7b318&gt;] syscall_call+0x7/0xb
    [&lt;ffffffff&gt;] 0xffffffff

Signed-off-by: Alexander Usyskin &lt;alexander.usyskin@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
