soc: qcom: tracer_pkt: Fix buffer length check
The logic to truncate packets if the size is too long was off by one. Fix the conditional logic for checking lengths. CRs-Fixed: 2121368 Change-Id: I908bd0a1ab78dea439056dbcd12eb158b2789e4a Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
parent
8e181ea4e8
commit
1c8d205e09
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2015, 2018, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -100,7 +100,7 @@ int tracer_pkt_init(void *data, size_t data_len,
|
||||||
pkt_hdr->reserved = 0;
|
pkt_hdr->reserved = 0;
|
||||||
pkt_hdr->id_valid = 0;
|
pkt_hdr->id_valid = 0;
|
||||||
pkt_hdr->qdss_tracing = qdss_tracing ? true : false;
|
pkt_hdr->qdss_tracing = qdss_tracing ? true : false;
|
||||||
if (pkt_priv_len > MAX_CC_WLEN * sizeof(uint32_t))
|
if (pkt_priv_len >= MAX_CC_WLEN * sizeof(uint32_t))
|
||||||
pkt_hdr->ccl = MAX_CC_WLEN;
|
pkt_hdr->ccl = MAX_CC_WLEN;
|
||||||
else
|
else
|
||||||
pkt_hdr->ccl = pkt_priv_len/sizeof(uint32_t) +
|
pkt_hdr->ccl = pkt_priv_len/sizeof(uint32_t) +
|
||||||
|
|
Loading…
Add table
Reference in a new issue