]> git.baikalelectronics.ru Git - kernel.git/commit
staging: r8822be: fix null pointer dereference with a null driver_adapter
authorColin Ian King <colin.king@canonical.com>
Wed, 23 Aug 2017 15:07:10 +0000 (16:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 08:27:28 +0000 (10:27 +0200)
commitb15142aef3c6c13ae0894781858e018bca39c162
treec0fff8894901223e5d7784820c504984d10fa573
parent9334ea1b79ba3dde6b0651f527d7a04969357e0e
staging: r8822be: fix null pointer dereference with a null driver_adapter

The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null
pointer deference on the null driver_adapter.  Fix this by assigning
driver_adapter earlier to halmac_adapter->driver_adapter before the tracing
call so that a non-null driver_adapter is passed instead.

Detected by CoverityScan, CID#1454613 ("Explicit null dereferenced")

Fixes: 68ad7ed11685 ("staging: r8822be: Add code for halmac sub-driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c