Commit 8f6b8ed3 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

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: acceb12a ("staging: wilc1000: refactor code to avoid static variables for config parameters")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 96e47e30
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment