<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/staging/rtl8712, branch v6.6</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>staging: rtl8712: fix race condition</title>
<updated>2023-08-04T14:20:13+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcaov@gmail.com</email>
</author>
<published>2023-07-31T11:06:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1422b526fba994cf05fd288a152106563b875fce'/>
<id>1422b526fba994cf05fd288a152106563b875fce</id>
<content type='text'>
In probe function, request_firmware_nowait() is called to load firmware
asynchronously. At completion of firmware loading, register_netdev() is
called. However, a mutex needed by netdev is initialized after the call
to request_firmware_nowait(). Consequently, it can happen that
register_netdev() is called before the driver is ready.

Move the mutex initialization into r8712_init_drv_sw(), which is called
before request_firmware_nowait().

Reported-by: syzbot+b08315e8cf5a78eed03c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-staging/000000000000d9d4560601b8e0d7@google.com/T/#u
Fixes: 8c213fa59199 ("staging: r8712u: Use asynchronous firmware loading")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/20230731110620.116562-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In probe function, request_firmware_nowait() is called to load firmware
asynchronously. At completion of firmware loading, register_netdev() is
called. However, a mutex needed by netdev is initialized after the call
to request_firmware_nowait(). Consequently, it can happen that
register_netdev() is called before the driver is ready.

Move the mutex initialization into r8712_init_drv_sw(), which is called
before request_firmware_nowait().

Reported-by: syzbot+b08315e8cf5a78eed03c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-staging/000000000000d9d4560601b8e0d7@google.com/T/#u
Fixes: 8c213fa59199 ("staging: r8712u: Use asynchronous firmware loading")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/20230731110620.116562-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: r8712: Fix memory leak in _r8712_init_xmit_priv()</title>
<updated>2023-07-27T07:50:57+00:00</updated>
<author>
<name>Larry Finger</name>
<email>Larry.Finger@lwfinger.net</email>
</author>
<published>2023-07-14T17:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ac83631230f77dda94154ed0ebfd368fc81c70a3'/>
<id>ac83631230f77dda94154ed0ebfd368fc81c70a3</id>
<content type='text'>
In the above mentioned routine, memory is allocated in several places.
If the first succeeds and a later one fails, the routine will leak memory.
This patch fixes commit 2865d42c78a9 ("staging: r8712u: Add the new driver
to the mainline kernel"). A potential memory leak in
r8712_xmit_resource_alloc() is also addressed.

Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Reported-by: syzbot+cf71097ffb6755df8251@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/x/log.txt?x=11ac3fa0a80000
Cc: stable@vger.kernel.org
Cc: Nam Cao &lt;namcaov@gmail.com&gt;
Signed-off-by: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Reviewed-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/20230714175417.18578-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the above mentioned routine, memory is allocated in several places.
If the first succeeds and a later one fails, the routine will leak memory.
This patch fixes commit 2865d42c78a9 ("staging: r8712u: Add the new driver
to the mainline kernel"). A potential memory leak in
r8712_xmit_resource_alloc() is also addressed.

Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Reported-by: syzbot+cf71097ffb6755df8251@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/x/log.txt?x=11ac3fa0a80000
Cc: stable@vger.kernel.org
Cc: Nam Cao &lt;namcaov@gmail.com&gt;
Signed-off-by: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Reviewed-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/20230714175417.18578-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8172: Add blank lines after declarations</title>
<updated>2023-04-15T16:04:36+00:00</updated>
<author>
<name>Srihari S</name>
<email>sriharisat@gmail.com</email>
</author>
<published>2023-04-08T15:16:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=86d3ad9684562cd3cee30f28d5976cd92e702473'/>
<id>86d3ad9684562cd3cee30f28d5976cd92e702473</id>
<content type='text'>
Add blank lines as reported by checkpatch.pl as below

CHECK: Please use a blank line after function/struct/union/enum declarations

Signed-off-by: Srihari S &lt;sriharisat@gmail.com&gt;
Link: https://lore.kernel.org/r/1680966983-11609-1-git-send-email-sriharisat@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add blank lines as reported by checkpatch.pl as below

CHECK: Please use a blank line after function/struct/union/enum declarations

Signed-off-by: Srihari S &lt;sriharisat@gmail.com&gt;
Link: https://lore.kernel.org/r/1680966983-11609-1-git-send-email-sriharisat@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: Fix multiple line dereference</title>
<updated>2023-03-08T16:00:53+00:00</updated>
<author>
<name>Shibo Li</name>
<email>zzutcyha@163.com</email>
</author>
<published>2023-02-20T08:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=dd680522f6aefeae94107bf4106b6f2da31c5025'/>
<id>dd680522f6aefeae94107bf4106b6f2da31c5025</id>
<content type='text'>
This patch fixes the following warning in rtl871x_mlme.c

WARNING: Avoid multiple line dereference - prefer 'adapter-&gt;securitypriv.PrivacyAlgrthm'

Signed-off-by: Shibo Li &lt;zzutcyha@163.com&gt;
Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt; AW-NU120
Reviewed-by: Dan Carpenter &lt;error27@gmail.com&gt;
Link: https://lore.kernel.org/r/20230220084050.18459-1-zzutcyha@163.com
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 patch fixes the following warning in rtl871x_mlme.c

WARNING: Avoid multiple line dereference - prefer 'adapter-&gt;securitypriv.PrivacyAlgrthm'

Signed-off-by: Shibo Li &lt;zzutcyha@163.com&gt;
Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt; AW-NU120
Reviewed-by: Dan Carpenter &lt;error27@gmail.com&gt;
Link: https://lore.kernel.org/r/20230220084050.18459-1-zzutcyha@163.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: Remove extra spaces</title>
<updated>2023-03-08T16:00:02+00:00</updated>
<author>
<name>Shibo Li</name>
<email>zzutcyha@163.com</email>
</author>
<published>2023-02-20T09:04:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d1c1ace35e1586025a56c39eb201b6d54a592a09'/>
<id>d1c1ace35e1586025a56c39eb201b6d54a592a09</id>
<content type='text'>
This patch fixes the problem of irregular indentation

Signed-off-by: Shibo Li &lt;zzutcyha@163.com&gt;
Link: https://lore.kernel.org/r/20230220090430.19589-1-zzutcyha@163.com
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 patch fixes the problem of irregular indentation

Signed-off-by: Shibo Li &lt;zzutcyha@163.com&gt;
Link: https://lore.kernel.org/r/20230220090430.19589-1-zzutcyha@163.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: fix potential memory leak</title>
<updated>2022-10-31T08:08:30+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcaov@gmail.com</email>
</author>
<published>2022-10-25T09:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=336ccc31cda111c830332d4b56def49c9c1d48e6'/>
<id>336ccc31cda111c830332d4b56def49c9c1d48e6</id>
<content type='text'>
In r8712_init_drv_sw(), whenever any function call returns error, it is
returned immediately without properly cleaning up the other successfully
executed functions. This can cause memory leak.

Instead of return immediately, free all the allocated buffers first.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/0a3414b12031f6cdcba81a8725e91eb9567ff34f.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In r8712_init_drv_sw(), whenever any function call returns error, it is
returned immediately without properly cleaning up the other successfully
executed functions. This can cause memory leak.

Instead of return immediately, free all the allocated buffers first.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/0a3414b12031f6cdcba81a8725e91eb9567ff34f.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: check for return value of _r8712_init_xmit_priv()</title>
<updated>2022-10-31T08:08:30+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcaov@gmail.com</email>
</author>
<published>2022-10-25T09:12:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=242443430dd8ef932a56cf483080a46f2948dd65'/>
<id>242443430dd8ef932a56cf483080a46f2948dd65</id>
<content type='text'>
The return value of _r8712_init_xmit_priv() is never checked and the driver
always continue execution as if all is well. This will cause problems
if, for example, buffers cannot be allocated and the driver continue and
use those buffers.

Check for return value of _r8712_init_xmit_priv() and return error (if any)
during probing.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/b550803561acf26af71f2377215c28b94435a644.1666688642.git.namcaov@gmail.com
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 return value of _r8712_init_xmit_priv() is never checked and the driver
always continue execution as if all is well. This will cause problems
if, for example, buffers cannot be allocated and the driver continue and
use those buffers.

Check for return value of _r8712_init_xmit_priv() and return error (if any)
during probing.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/b550803561acf26af71f2377215c28b94435a644.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: check for alloc fail in _r8712_init_recv_priv()</title>
<updated>2022-10-31T08:08:30+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcaov@gmail.com</email>
</author>
<published>2022-10-25T09:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=63b5e50571ce4d87cd6c1c4d99de74c9d86fd0d8'/>
<id>63b5e50571ce4d87cd6c1c4d99de74c9d86fd0d8</id>
<content type='text'>
The function _r8712_init_recv_priv() and also r8712_init_recv_priv()
just returns silently if they fail to allocate memory. Change their
return type to int and add necessary checks and handling if they return
-ENOMEM

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/506ac35a667e511db568b06b86834fd0ceeba453.1666688642.git.namcaov@gmail.com
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 function _r8712_init_recv_priv() and also r8712_init_recv_priv()
just returns silently if they fail to allocate memory. Change their
return type to int and add necessary checks and handling if they return
-ENOMEM

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/506ac35a667e511db568b06b86834fd0ceeba453.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "staging: r8712u: Tracking kmemleak false positives."</title>
<updated>2022-10-31T08:08:30+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcaov@gmail.com</email>
</author>
<published>2022-10-25T09:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c5a7eecdcdb6c9d3a907ee66db2b5cffc8bdb4e1'/>
<id>c5a7eecdcdb6c9d3a907ee66db2b5cffc8bdb4e1</id>
<content type='text'>
This reverts commit 5d3da4a20a271e3cf5496a50cbb8118aa019374f.

This commit annotated false positive for kmemleak. The reasoning is that
the buffers are freed when the driver is unloaded. However, there is
actually potential memory leak when probe fails.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/26ce206b2c40c7db48c146aa6105789db9dfcc1a.1666688642.git.namcaov@gmail.com
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 reverts commit 5d3da4a20a271e3cf5496a50cbb8118aa019374f.

This commit annotated false positive for kmemleak. The reasoning is that
the buffers are freed when the driver is unloaded. However, there is
actually potential memory leak when probe fails.

Tested-by: Philipp Hortmann &lt;philipp.g.hortmann@gmail.com&gt;
Signed-off-by: Nam Cao &lt;namcaov@gmail.com&gt;
Link: https://lore.kernel.org/r/26ce206b2c40c7db48c146aa6105789db9dfcc1a.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: rtl8712: Remove variable xcnt</title>
<updated>2022-10-22T07:58:35+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.i.king@gmail.com</email>
</author>
<published>2022-10-21T18:09:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=acd50e52a7f2e75b3109523d2f114fa46a4362c0'/>
<id>acd50e52a7f2e75b3109523d2f114fa46a4362c0</id>
<content type='text'>
The variable xcnt being incremented but it is never referenced,
it is redundant and can be removed.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Link: https://lore.kernel.org/r/20221021180950.29139-1-colin.i.king@gmail.com
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 xcnt being incremented but it is never referenced,
it is redundant and can be removed.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Link: https://lore.kernel.org/r/20221021180950.29139-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
