From 0cc62331574a331c3172d04b04f9ddd30794023d Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Wed, 9 Oct 2019 09:32:43 +0530 Subject: [PATCH] qcacld-3.0: Add flush callback for umac stop During the scheduler_stop it tries to flush all the pending messages in the queue, during the same the flush callbacks of all the pending messages are invoked. If there is no flush callback for SYS_MSG_ID_UMAC_STOP, it will free the bodyptr of the message which contains the global variable g_stop_evt, which can result in invalid access in the other thread. Add a dummy flush callback message for the sys_stop message to avoid the invalid access. Change-Id: I46ca4240d787dce5b21cc2f99ced66a4c01b737c CRs-Fixed: 2537773 --- core/mac/src/sys/common/src/wlan_qct_sys.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c index ec2647d8b157..66499fdaf55e 100644 --- a/core/mac/src/sys/common/src/wlan_qct_sys.c +++ b/core/mac/src/sys/common/src/wlan_qct_sys.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 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 @@ -72,6 +72,11 @@ static void umac_stop_complete_cb(void *user_data) } #endif +static inline QDF_STATUS umac_stop_flush_cb(struct scheduler_msg *msg) +{ + return QDF_STATUS_SUCCESS; +} + /** * umac_stop() - To post stop message to system module * @@ -96,6 +101,7 @@ QDF_STATUS umac_stop(void) /* Save the user callback and user data */ umac_stop_msg.callback = umac_stop_complete_cb; umac_stop_msg.bodyptr = (void *)&g_stop_evt; + umac_stop_msg.flush_callback = umac_stop_flush_cb; /* post the message.. */ qdf_status = scheduler_post_message(QDF_MODULE_ID_SYS,