| .. | .. |
|---|
| 886 | 886 | u8 *scan_params = NULL, *params = NULL; |
|---|
| 887 | 887 | s32 params_size; |
|---|
| 888 | 888 | u32 n_channels = 0; |
|---|
| 889 | | - wl_uint32_list_t *list; |
|---|
| 890 | | - u8 valid_chan_list[sizeof(u32)*(MAX_CTRL_CHANSPECS + 1)]; |
|---|
| 889 | + wl_uint32_list_t *list = NULL; |
|---|
| 891 | 890 | |
|---|
| 892 | 891 | mutex_lock(&escan->usr_sync); |
|---|
| 893 | 892 | if (escan->escan_state == ESCAN_STATE_DOWN) { |
|---|
| .. | .. |
|---|
| 920 | 919 | } |
|---|
| 921 | 920 | |
|---|
| 922 | 921 | /* if scan request is not empty parse scan request paramters */ |
|---|
| 923 | | - memset(valid_chan_list, 0, sizeof(valid_chan_list)); |
|---|
| 924 | | - list = (wl_uint32_list_t *)(void *) valid_chan_list; |
|---|
| 922 | + list = kzalloc(sizeof(u32)*(MAX_CTRL_CHANSPECS + 1), GFP_KERNEL); |
|---|
| 923 | + if (list == NULL) { |
|---|
| 924 | + ESCAN_ERROR(dev->name, "kzalloc failed\n"); |
|---|
| 925 | + err = -ENOMEM; |
|---|
| 926 | + goto exit; |
|---|
| 927 | + } |
|---|
| 925 | 928 | |
|---|
| 926 | 929 | if (scan_info->channels.count) { |
|---|
| 927 | 930 | memcpy(list, &scan_info->channels, sizeof(wl_channel_list_t)); |
|---|
| .. | .. |
|---|
| 984 | 987 | } |
|---|
| 985 | 988 | kfree(params); |
|---|
| 986 | 989 | exit: |
|---|
| 990 | + if (list) |
|---|
| 991 | + kfree(list); |
|---|
| 987 | 992 | if (unlikely(err)) { |
|---|
| 988 | 993 | wl_escan_reset(escan); |
|---|
| 989 | 994 | } |
|---|