summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/camera.c
diff options
context:
space:
mode:
authorJohan Hovold2015-12-30 11:23:51 +0100
committerGreg Kroah-Hartman2015-12-30 22:16:06 +0100
commit41c23958557d9b37755768849ee39b99a9826a9c (patch)
tree0451e8aeb739f32c2a89e64464eab0df639938b9 /drivers/staging/greybus/camera.c
parentgreybus: camera: fix memory leak in capture-request handler (diff)
downloadkernel-qcow2-linux-41c23958557d9b37755768849ee39b99a9826a9c.tar.gz
kernel-qcow2-linux-41c23958557d9b37755768849ee39b99a9826a9c.tar.xz
kernel-qcow2-linux-41c23958557d9b37755768849ee39b99a9826a9c.zip
greybus: camera: destroy data connection on link-config errors
Make sure to tear down the data connection also on failure to configure the link by setting the data_connected flag immediately after creating the connection. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/camera.c')
-rw-r--r--drivers/staging/greybus/camera.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c
index ec7d4a082ab1..b181ac49e783 100644
--- a/drivers/staging/greybus/camera.c
+++ b/drivers/staging/greybus/camera.c
@@ -604,6 +604,8 @@ static int gb_camera_connection_init(struct gb_connection *connection)
if (ret < 0)
goto error;
+ gcam->data_connected = true;
+
ret = gb_svc_link_config(svc, connection->intf->interface_id,
GB_SVC_LINK_CONFIG_BURST_HS_A, 2, 2, 0);
if (ret < 0)
@@ -614,8 +616,6 @@ static int gb_camera_connection_init(struct gb_connection *connection)
if (ret < 0)
goto error;
- gcam->data_connected = true;
-
ret = gb_camera_debugfs_init(gcam);
if (ret < 0)
goto error;