Jelajahi Sumber

qcacld-3.0: Don't start vdev trans if vdev ops is pending

Currently for REASSOC command host starts vdev ops
and tries to use vdev. In parallel if host receives
interface down and starts vdev trans then proceeds
to stop adapter and destroys the vdev, this leads
to null pointer dereference if vdev is destroyed
first.

This happens because driver doesn't wait for vdev ops
to complete after starting vdev trans.

To address this issue, start vdev trans and wait for
vdev ops to complete before proceeding to execute
further.

Change-Id: I363d05f742f7569dffed70cfa9b6bb9a0a766d9e
CRs-Fixed: 3445858
Asutosh Mohapatra 2 tahun lalu
induk
melakukan
4a32419413
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      os_if/sync/src/osif_vdev_sync.c

+ 7 - 1
os_if/sync/src/osif_vdev_sync.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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
@@ -249,6 +249,9 @@ int __osif_vdev_sync_trans_start(struct net_device *net_dev,
 						dsc_vdev_trans_start);
 	osif_vdev_sync_unlock();
 
+	if (!errno)
+		osif_vdev_sync_wait_for_ops(*out_vdev_sync);
+
 	return errno;
 }
 
@@ -263,6 +266,9 @@ int __osif_vdev_sync_trans_start_wait(struct net_device *net_dev,
 						     out_vdev_sync, desc,
 						     dsc_vdev_trans_start_wait);
 
+	if (!errno)
+		osif_vdev_sync_wait_for_ops(*out_vdev_sync);
+
 	return errno;
 }