Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit fc29c002 authored by Ming Lei's avatar Ming Lei Committed by Lingutla Chandrasekhar
Browse files

driver core: fix race between creating/querying glue dir and its cleanup



The global mutex of 'gdp_mutex' is used to serialize creating/querying
glue dir and its cleanup. Turns out it isn't a perfect way because
part(kobj_kset_leave()) of the actual cleanup action() is done inside
the release handler of the glue dir kobject. That means gdp_mutex has
to be held before releasing the last reference count of the glue dir
kobject.

This patch moves glue dir's cleanup after kobject_del() in device_del()
for avoiding the race.

Change-Id: I92b10e62be8129ead5859a285bf964ab0a3ae2fd
Cc: Yijing Wang <wangyijing@huawei.com>
Reported-by: default avatarChandra Sekhar Lingutla <clingutla@codeaurora.org>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: cebf8fd16900fdfd58c0028617944f808f97fe50
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent ce610f2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment