greybus: camera: fix memory leak in configure-streams error path
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 30 Dec 2015 10:08:00 +0000 (11:08 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 30 Dec 2015 21:16:06 +0000 (13:16 -0800)
Fix memory leak in configure-streams error path by making sure to
release the operation buffers before returning.

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>
drivers/staging/greybus/camera.c

index c742fea294924b22eadcad5919f15cb54cabf054..8b2eedd29cb3e6ca10fceba4ba82b211ee07f6a2 100644 (file)
@@ -115,7 +115,7 @@ static int gb_camera_configure_streams(struct gb_camera *gcam,
                                GB_CAMERA_TYPE_CONFIGURE_STREAMS,
                                req, req_size, resp, resp_size);
        if (ret < 0)
-               return ret;
+               goto done;
 
        if (le16_to_cpu(resp->num_streams) > nstreams) {
                gcam_dbg(gcam, "got #streams %u > request %u\n",