eeprom.c (f26e8817b235d8764363bffcc9cbfc61867371f2) | eeprom.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb) |
---|---|
1/* 2 * EEPROM parser code for mac80211 Prism54 drivers 3 * 4 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> 5 * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de> 6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> 7 * 8 * Based on: --- 147 unchanged lines hidden (view full) --- 156 157 if ((!list->entries) || (!list->band_channel_num[band])) 158 return -EINVAL; 159 160 tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); 161 if (!tmp) 162 goto err_out; 163 | 1/* 2 * EEPROM parser code for mac80211 Prism54 drivers 3 * 4 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> 5 * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de> 6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> 7 * 8 * Based on: --- 147 unchanged lines hidden (view full) --- 156 157 if ((!list->entries) || (!list->band_channel_num[band])) 158 return -EINVAL; 159 160 tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); 161 if (!tmp) 162 goto err_out; 163 |
164 tmp->channels = kzalloc(sizeof(struct ieee80211_channel) * 165 list->band_channel_num[band], GFP_KERNEL); | 164 tmp->channels = kcalloc(list->band_channel_num[band], 165 sizeof(struct ieee80211_channel), 166 GFP_KERNEL); |
166 if (!tmp->channels) 167 goto err_out; 168 169 ret = p54_fill_band_bitrates(dev, tmp, band); 170 if (ret) 171 goto err_out; 172 173 for (i = 0, j = 0; (j < list->band_channel_num[band]) && --- 165 unchanged lines hidden (view full) --- 339 priv->curve_data->entries); 340 341 list = kzalloc(sizeof(*list), GFP_KERNEL); 342 if (!list) { 343 ret = -ENOMEM; 344 goto free; 345 } 346 priv->chan_num = max_channel_num; | 167 if (!tmp->channels) 168 goto err_out; 169 170 ret = p54_fill_band_bitrates(dev, tmp, band); 171 if (ret) 172 goto err_out; 173 174 for (i = 0, j = 0; (j < list->band_channel_num[band]) && --- 165 unchanged lines hidden (view full) --- 340 priv->curve_data->entries); 341 342 list = kzalloc(sizeof(*list), GFP_KERNEL); 343 if (!list) { 344 ret = -ENOMEM; 345 goto free; 346 } 347 priv->chan_num = max_channel_num; |
347 priv->survey = kzalloc(sizeof(struct survey_info) * max_channel_num, | 348 priv->survey = kcalloc(max_channel_num, sizeof(struct survey_info), |
348 GFP_KERNEL); 349 if (!priv->survey) { 350 ret = -ENOMEM; 351 goto free; 352 } 353 354 list->max_entries = max_channel_num; | 349 GFP_KERNEL); 350 if (!priv->survey) { 351 ret = -ENOMEM; 352 goto free; 353 } 354 355 list->max_entries = max_channel_num; |
355 list->channels = kzalloc(sizeof(struct p54_channel_entry) * 356 max_channel_num, GFP_KERNEL); | 356 list->channels = kcalloc(max_channel_num, 357 sizeof(struct p54_channel_entry), 358 GFP_KERNEL); |
357 if (!list->channels) { 358 ret = -ENOMEM; 359 goto free; 360 } 361 362 for (i = 0; i < max_channel_num; i++) { 363 if (i < priv->iq_autocal_len) { 364 freq = le16_to_cpu(priv->iq_autocal[i].freq); --- 618 unchanged lines hidden --- | 359 if (!list->channels) { 360 ret = -ENOMEM; 361 goto free; 362 } 363 364 for (i = 0; i < max_channel_num; i++) { 365 if (i < priv->iq_autocal_len) { 366 freq = le16_to_cpu(priv->iq_autocal[i].freq); --- 618 unchanged lines hidden --- |