Commit 612ac896 authored by Wang Hai's avatar Wang Hai Committed by sanglipeng
Browse files

arcnet: fix potential memory leak in com20020_probe()

stable inclusion
from stable-v5.10.157
commit 9cc863d523999de19f609bf8da49d6dad2bba193
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9cc863d523999de19f609bf8da49d6dad2bba193



--------------------------------

[ Upstream commit 1c40cde6 ]

In com20020_probe(), if com20020_config() fails, dev and info
will not be freed, which will lead to a memory leak.

This patch adds freeing dev and info after com20020_config()
fails to fix this bug.

Compile tested only.

Fixes: 15b99ac1 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent ebcabe60
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment