mirror of https://gitee.com/openkylin/linux.git
greybus: camera: Initialize mutex before using it
We are using the mutex from gb_camera_cleanup(), which can get called even before the mutex is initialized. Fix it by initializing the mutex early enough. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
54131222e6
commit
d9e4c4ee12
|
@ -999,6 +999,7 @@ static int gb_camera_probe(struct gb_bundle *bundle,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
gcam->bundle = bundle;
|
gcam->bundle = bundle;
|
||||||
|
mutex_init(&gcam->mutex);
|
||||||
|
|
||||||
conn = gb_connection_create(bundle, mgmt_cport_id,
|
conn = gb_connection_create(bundle, mgmt_cport_id,
|
||||||
gb_camera_request_handler);
|
gb_camera_request_handler);
|
||||||
|
@ -1014,8 +1015,6 @@ static int gb_camera_probe(struct gb_bundle *bundle,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
mutex_init(&gcam->mutex);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the data connection between the camera module data CPort and
|
* Create the data connection between the camera module data CPort and
|
||||||
* APB CDSI1. The CDSI1 CPort ID is hardcoded by the ES2 bridge.
|
* APB CDSI1. The CDSI1 CPort ID is hardcoded by the ES2 bridge.
|
||||||
|
|
Loading…
Reference in New Issue