Unverified Commit 0a85d02b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 75538b09 40d47627
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1401,10 +1401,14 @@ int cfg80211_wext_siwscan(struct net_device *dev,
	wiphy = &rdev->wiphy;

	/* Determine number of channels, needed to allocate creq */
	if (wreq && wreq->num_channels)
	if (wreq && wreq->num_channels) {
		/* Passed from userspace so should be checked */
		if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES))
			return -EINVAL;
		n_channels = wreq->num_channels;
	else
	} else {
		n_channels = ieee80211_get_num_supported_channels(wiphy);
	}

	creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) +
		       n_channels * sizeof(void *),