]> git.baikalelectronics.ru Git - kernel.git/commit
opp: Don't decrement uninitialized list_kref
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 3 Jul 2019 09:33:14 +0000 (15:03 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 26 Jul 2019 07:55:52 +0000 (13:25 +0530)
commit98c4b96659c0442c8f48abcba5a5402c66f9a851
tree09baf01360b13b1cc995c8620b0b5c51af52bc5d
parentb588795291e5012f43641a6b0d57d59193fc287c
opp: Don't decrement uninitialized list_kref

The list_kref was added for static OPPs and to track their users. The
kref is initialized while the static OPPs are added, but removed
unconditionally even if the static OPPs were never added. This causes
refcount mismatch warnings currently.

Fix that by always initializing the kref when the OPP table is first
initialized. The refcount is later incremented only for the second user
onwards.

Fixes: 59a7baac4a3b ("OPP: Create separate kref for static OPPs list")
Reported-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
drivers/opp/of.c