cfg80211: use better order for kcalloc() arguments
authorJohannes Berg <johannes.berg@intel.com>
Wed, 23 May 2018 12:53:41 +0000 (14:53 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Fri, 15 Jun 2018 11:34:06 +0000 (13:34 +0200)
The arguments should be (# of elements, size of each) instead
of the other way around, which really ends up being mostly
equivalent but smatch complains about it, so swap them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
net/wireless/util.c

index b5bb1c30991461d980cd57e3e582e3ca69ac4516..b91597a8baa24aaf892d9fafae526dc530909762 100644 (file)
@@ -1789,8 +1789,9 @@ bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range,
 
 int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp)
 {
-       sinfo->pertid = kcalloc(sizeof(*(sinfo->pertid)),
-                               IEEE80211_NUM_TIDS + 1, gfp);
+       sinfo->pertid = kcalloc(IEEE80211_NUM_TIDS + 1,
+                               sizeof(*(sinfo->pertid)),
+                               gfp);
        if (!sinfo->pertid)
                return -ENOMEM;