qcacmn: Add NULL ptr and data initialization checks in pktlog

Add checks for NULL ptr. Also initialize data properly.

Change-Id: Ib6db409f038421c5a0c9033bea7948f9cd6376dd
CRs-Fixed: 2160752
This commit is contained in:
Amar Singhal
2018-01-02 15:30:49 -08:00
committed by snandini
parent c686275355
commit 479698e1d7
3 changed files with 19 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -165,7 +165,6 @@ void pktlog_release_buf(struct hif_opaque_softc *scn)
struct ath_pktlog_info *pl_info;
pl_dev = get_pktlog_handle();
pl_info = pl_dev->pl_info;
if (!pl_dev) {
qdf_print("%s: invalid pl_dev handle", __func__);
@@ -177,6 +176,8 @@ void pktlog_release_buf(struct hif_opaque_softc *scn)
return;
}
pl_info = pl_dev->pl_info;
page_cnt = ((sizeof(*(pl_info->buf)) + pl_info->buf_size) /
PAGE_SIZE) + 1;