Skip to content

Commit

Permalink
raw/cnxk_gpio: fix resource leak
Browse files Browse the repository at this point in the history
Fix resource leak.

Coverity issue: 405118
Fixes: ef2a3f3 ("raw/cnxk_gpio: support multi-process")

Signed-off-by: Tomasz Duszynski <[email protected]>
  • Loading branch information
Tomasz Duszynski authored and jerinjacobk committed Nov 7, 2023
1 parent fd49346 commit d677a3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/raw/cnxk_gpio/cnxk_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ cnxk_gpio_parse_store_args(struct cnxk_gpio_params **params, const char *args)
len += strlen(allowlist) + 1;

*params = cnxk_gpio_params_reserve(len);
if (!(*params))
return -ENOMEM;
if (!(*params)) {
ret = -ENOMEM;
goto out;
}

strlcpy((*params)->allowlist, allowlist, strlen(allowlist) + 1);

Expand Down

0 comments on commit d677a3e

Please sign in to comment.