qcacmn: Fix NULL pointer dereference in qdf_nbuf_free

Move network buffer null check to beginning of function to
cover possible case of null pointer dereference during free.

Change-Id: I8c998d4d1711ab28c94a946d04314c26a4c74278
CRs-fixed: 2309452
This commit is contained in:
Manikandan Mohan
2018-09-11 11:23:51 -07:00
committed by nshrivas
parent 8a32229408
commit 33cfb578b0
2 changed files with 8 additions and 6 deletions

View File

@@ -1336,7 +1336,8 @@ qdf_nbuf_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve, int align,
static inline void qdf_nbuf_free(qdf_nbuf_t buf)
{
__qdf_nbuf_free(buf);
if (qdf_likely(buf))
__qdf_nbuf_free(buf);
}
/**