]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr
authorColin Ian King <colin.king@canonical.com>
Wed, 28 Feb 2018 11:28:49 +0000 (11:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Mar 2018 16:26:13 +0000 (17:26 +0100)
commit1079815f1c3f56a81da9a7673531ac74bb8de6ab
tree39ebc19e53a5fd5d20f01361e2321ba51af1bf40
parent0b50b34f3ae544e63429cce7146b498d3e7ab1fd
staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr

Currently the allocation of priv->oldaddr is not null checked which will
lead to subsequent errors when accessing priv->oldaddr.  Fix this with
a null pointer check and a return of -ENOMEM on allocation failure.

Detected with Coccinelle:
drivers/staging/rtl8192u/r8192U_core.c:1708:2-15: alloc with no test,
possible model on line 1723

Fixes: 33d35d972f59 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_core.c