cifs: Fix a tiny potential memory leak
The most recent "it" allocation is leaked on this error path. I
believe that small allocations always succeed in current kernels so
this doesn't really affect run time.
Fixes: 54be1f6c1c
("cifs: Add DFS cache routines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
hifive-unleashed-5.1
parent
8428817dc4
commit
c715f89c4d
|
@ -776,6 +776,7 @@ static int get_tgt_list(const struct dfs_cache_entry *ce,
|
||||||
it->it_name = kstrndup(t->t_name, strlen(t->t_name),
|
it->it_name = kstrndup(t->t_name, strlen(t->t_name),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!it->it_name) {
|
if (!it->it_name) {
|
||||||
|
kfree(it);
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err_free_it;
|
goto err_free_it;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue