Skip to content
Commit 7f7ed584 authored by Alex Elder's avatar Alex Elder Committed by Mike Turquette
Browse files

clk: get matching entry under lock in of_clk_init()



Currently of_clk_init() finds a matching device node while holding
the device tree spinlock.  When a matching device node is found, the
lock is dropped and then re-acquired in order to get a reference
to the matching device id structure.

Acquiring the spinlock twice is unnecessary (and it opens a
vulnerable window that could conceivably lead to errors).

There already exists an interface for both finding and taking a
reference to a device id under lock, so use it.

Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarChristian Daudt <csd@broadcom.com>
Reviewed-by: default avatarMarkus Mayer <markus.mayer@linaro.org>
Reviewed-by: default avatarMatt Porter <matt.porter@linaro.org>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent 1ec5502e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment