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>
This commit is contained in:
parent
96e47e30c0
commit
8f6b8ed3b0
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user