Commit 6b63f950 authored by Yang Yingliang's avatar Yang Yingliang Committed by Zheng Zengkai
Browse files

pcmcia: ds: fix refcount leak in pcmcia_device_add()

stable inclusion
from stable-v6.6.2
commit 5439f09724561d5417b559d70d7043db76e104ce
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IW7G

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



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

[ Upstream commit 402ab979b29126068e0b596b641422ff7490214c ]

As the comment of device_register() says, it should use put_device()
to give up the reference in the error path. Then, insofar resources
will be freed in pcmcia_release_dev(), the error path is no longer
needed. In particular, this means that the (previously missing) dropping
of the reference to &p_dev->function_config->ref is now handled by
pcmcia_release_dev().

Fixes: 360b65b9 ("[PATCH] pcmcia: make config_t independent, add reference counting")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
[linux@dominikbrodowski.net: simplification, commit message rewrite]
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 6d46a22b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment