From f2e213b3221ef011bd16ff4437f5315a90e9c284 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 9 Jan 2018 14:38:45 -0800 Subject: [PATCH] qcacld-3.0: Fix static analysis issues in wlan_hdd_lro.c Fix NULL dereference a pointer returned from call to function 'cds_get_context'. Change-Id: I4c09309b5813f105ccf1c836b81a92522d81df75 CRs-Fixed: 2162256 --- core/hdd/src/wlan_hdd_lro.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index c3a633483fd3..b48a55fb42b7 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -122,6 +122,7 @@ static qdf_lro_ctx_t wlan_hdd_get_lro_ctx(struct sk_buff *skb) (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); if (hif_hdl == NULL) { hdd_err("hif_hdl is NULL"); + return NULL; } return hif_get_lro_info(QDF_NBUF_CB_RX_CTX_ID(skb), hif_hdl); @@ -255,6 +256,11 @@ void hdd_disable_lro_in_concurrency(bool disable) { struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (hdd_ctx == NULL) { + hdd_err("hdd_ctx is NULL"); + return; + } + if (disable) { if (hdd_ctx->en_tcp_delack_no_lro) { struct wlan_rx_tp_data rx_tp_data;