Browse Source

qcacld-3.0: Fix build error when calling copy_to_user

API copy_to_user is defined with attribute warn_unused_result, Need
check return value of 'copy_to_user'.
Otherwise there is build error.

Change-Id: Ieff08745b2b80ea2fb8e2f0339461d907bbea292
CRs-Fixed: 3606214
Bing Sun 1 year ago
parent
commit
b044b0040f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      core/hdd/src/wlan_hdd_son.c

+ 4 - 1
core/hdd/src/wlan_hdd_son.c

@@ -2227,6 +2227,7 @@ static int hdd_son_get_acs_report(struct wlan_objmgr_vdev *vdev,
 	struct hdd_context *hdd_ctx;
 	struct ieee80211_acs_dbg *acs_r = NULL;
 	struct sap_context *sap_ctx;
+	qdf_size_t not_copied;
 
 	if (!acs_report) {
 		hdd_err("null acs_report");
@@ -2315,7 +2316,9 @@ static int hdd_son_get_acs_report(struct wlan_objmgr_vdev *vdev,
 				break;
 			}
 		}
-		copy_to_user(acs_report, acs_r, sizeof(*acs_r));
+		not_copied = copy_to_user(acs_report, acs_r, sizeof(*acs_r));
+		if (not_copied)
+			hdd_debug("%ul is not copied", not_copied);
 	} else if (acs_type == ACS_CHAN_NF_STATS) {
 	} else if (acs_type == ACS_NEIGHBOUR_GET_LIST_COUNT ||
 		   acs_type == ACS_NEIGHBOUR_GET_LIST) {