]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:28:56 +0000 (12:28 +0200)
commit7a330f6d8d5501e42acde177e684ca12e7a1bce0
tree12d49dd26564fe5d3d1eba6414c64a92c9559dbc
parenta5d4627ef0157405494da125ac06ce2869961049
staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit e1a7418529e33bc4efc346324557251a16a3e79b ]

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: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/rtl8192u/r8192U_core.c