aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-03-24 08:35:51 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-03-24 08:35:50 -0700
commita66085f73ae2cdd4a408e0fc8c4263ba9c5135ad (patch)
tree8e0e749239013d0e70bf3882f4ecd23d9fa1e7b7
parent48578c83af42f6858a2ca51747875568cce1517c (diff)
parent6385ebec8c5d7548b47962b0e1728e41a967d66f (diff)
Merge "soc: qcom: Update conditional logic for validating read and write index"LAW.BR.4.0-01600-89xx.0
-rw-r--r--drivers/soc/qcom/glink_smem_native_xprt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/qcom/glink_smem_native_xprt.c b/drivers/soc/qcom/glink_smem_native_xprt.c
index b817d064a91c..d8e5d9fb38a5 100644
--- a/drivers/soc/qcom/glink_smem_native_xprt.c
+++ b/drivers/soc/qcom/glink_smem_native_xprt.c
@@ -459,7 +459,7 @@ static int fifo_read(struct edge_info *einfo, void *_data, int len)
uint32_t fifo_size = einfo->rx_fifo_size;
uint32_t n;
- if (read_index > fifo_size && write_index > fifo_size)
+ if (read_index >= fifo_size || write_index >= fifo_size)
return 0;
while (len) {
ptr = einfo->rx_fifo + read_index;
@@ -507,7 +507,7 @@ static int fifo_write_body(struct edge_info *einfo, const void *_data,
uint32_t fifo_size = einfo->tx_fifo_size;
uint32_t n;
- if (read_index > fifo_size && *write_index > fifo_size)
+ if (read_index >= fifo_size || *write_index >= fifo_size)
return 0;
while (len) {
ptr = einfo->tx_fifo + *write_index;