]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: r8822be: fix null pointer dereferences with a null driver_adapter
authorColin Ian King <colin.king@canonical.com>
Fri, 8 Sep 2017 13:55:06 +0000 (14:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2017 10:25:31 +0000 (12:25 +0200)
commite1bf28868ab0bfd1fc73dd8d5e642d88456c30e9
treec56bed6261802dfc643ccbf3bab1f462d9f345a1
parenta3563b09f132661d447f69224ef65fdec02f5c61
staging: r8822be: fix null pointer dereferences with a null driver_adapter

The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null
pointer deference on a 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.

I should have spotted these with an earlier patch I sent, but I overlooked
these in the rather large CoverityScan logs.

Detected by CoverityScan, CID#1454550, CID#1454554, CID#1454565,
CID#1454591, CID#1454598 ("Explicit null dereferenced")

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