qcacld-3.0: Fix possible NULL pointer dereference in os_if_nan_legacy_req()
In function os_if_nan_legacy_req(), if qdf_mem_malloc() call return NULL, this will result in nan_req NULL pointer dereference. Fix is to add NULL pointer check for nan_req before using. Change-Id: I8ce9e9f9fa556606cf5e8d389905c39ff7198f2c CRs-Fixed: 2423772
This commit is contained in:
@@ -2575,6 +2575,9 @@ int os_if_nan_legacy_req(struct wlan_objmgr_psoc *psoc, const void *data,
|
||||
}
|
||||
|
||||
nan_req = qdf_mem_malloc(sizeof(*nan_req) + data_len);
|
||||
if (!nan_req)
|
||||
return -ENOMEM;
|
||||
|
||||
nan_req->psoc = psoc;
|
||||
nan_req->params.request_data_len = data_len;
|
||||
qdf_mem_copy(nan_req->params.request_data, data, data_len);
|
||||
|
Viittaa uudesa ongelmassa
Block a user