From b1e2bf5c79d33f26a4c9214c4983ccb7a9d4fc0d Mon Sep 17 00:00:00 2001 From: Chaitanya Kiran Godavarthi Date: Thu, 10 Jan 2019 15:05:17 +0530 Subject: [PATCH] qcacmn: KW fixes in Tx DP Add array bound check for Tx desc pool config Add NULL check for nbuf in case of segment frames Change-Id: I8b547edf641a7a21823506388b2c04715cffbf21 --- dp/wifi3.0/dp_tx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 4ba97d0bcff2..40bfad58d7c8 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2121,6 +2121,9 @@ qdf_nbuf_t dp_tx_send(void *vap_dev, qdf_nbuf_t nbuf) if (qdf_unlikely(qdf_nbuf_is_nonlinear(nbuf))) { nbuf = dp_tx_prepare_sg(vdev, nbuf, &seg_info, &msdu_info); + if (!nbuf) + return NULL; + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, "%s non-TSO SG frame %pK", __func__, vdev); @@ -3770,6 +3773,9 @@ QDF_STATUS dp_tx_soc_attach(struct dp_soc *soc) num_desc = wlan_cfg_get_num_tx_desc(soc->wlan_cfg_ctx); num_ext_desc = wlan_cfg_get_num_tx_ext_desc(soc->wlan_cfg_ctx); + if (num_pool > MAX_TXDESC_POOLS) + goto fail; + if (dp_tx_alloc_static_pools(soc, num_pool, num_desc)) goto fail;