diff options
author | Colin Ian King | 2018-09-27 14:17:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2018-09-28 14:30:52 +0200 |
commit | 8f6b8ed3b02e3202b062a0d786c1c623f64cad63 (patch) | |
tree | 63c045d16cf477c35a2569f72090a6a6f69608ad /drivers/staging/wilc1000 | |
parent | staging: rtl8188eu: Skip unnecessary field checks (diff) | |
download | kernel-qcow2-linux-8f6b8ed3b02e3202b062a0d786c1c623f64cad63.tar.gz kernel-qcow2-linux-8f6b8ed3b02e3202b062a0d786c1c623f64cad63.tar.xz kernel-qcow2-linux-8f6b8ed3b02e3202b062a0d786c1c623f64cad63.zip |
staging: wilc1000: fix incorrect allocation size for structure
Currently the allocation for str_vals is for the sizeof the pointer
rather than the size of the structure. Fix this.
Detected by smatch
"wilc_wlan_cfg_init() error: not allocating enough data 392 vs 8"
Fixes: acceb12a9f8b ("staging: wilc1000: refactor code to avoid static variables for config parameters")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan_cfg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c index 930a3896f4ae..faa001c75681 100644 --- a/drivers/staging/wilc1000/wilc_wlan_cfg.c +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c @@ -457,7 +457,7 @@ int wilc_wlan_cfg_init(struct wilc *wl) if (!wl->cfg.s) goto out_w; - str_vals = kzalloc(sizeof(str_vals), GFP_KERNEL); + str_vals = kzalloc(sizeof(*str_vals), GFP_KERNEL); if (!str_vals) goto out_s; |