Skip to content
Commit d2e12e66 authored by Dave Gerlach's avatar Dave Gerlach Committed by Bjorn Andersson
Browse files

remoteproc: Fix potential race condition in rproc_add

rproc_add adds the newly created remoteproc to a list for use by
rproc_get_by_phandle and then does some additional processing to finish
adding the remoteproc. This leaves a small window of time in which the
rproc is available in the list but not yet fully initialized, so if
another driver comes along and gets a handle to the rproc, it will be
invalid. Rearrange the code in rproc_add to make sure the rproc is added
to the list only after it has been successfuly initialized.

Fixes: fec47d86

 ("remoteproc: introduce rproc_get_by_phandle API")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDave Gerlach <d-gerlach@ti.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 15ebc72d
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