mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
greybus: camera: fix memory leak in capture-request handler
Fix memory leak in capture-request handler by making sure to release the operation request buffer after sending the request. 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>
This commit is contained in:
parent
12c8b0dcc8
commit
b9f71bc854
1 changed files with 6 additions and 1 deletions
|
@ -183,6 +183,7 @@ static int gb_camera_capture(struct gb_camera *gcam, u32 request_id,
|
|||
{
|
||||
struct gb_camera_capture_request *req;
|
||||
size_t req_size;
|
||||
int ret;
|
||||
|
||||
if (settings_size > GB_CAMERA_MAX_SETTINGS_SIZE)
|
||||
return -EINVAL;
|
||||
|
@ -198,8 +199,12 @@ static int gb_camera_capture(struct gb_camera *gcam, u32 request_id,
|
|||
req->num_frames = cpu_to_le16(num_frames);
|
||||
memcpy(req->settings, settings, settings_size);
|
||||
|
||||
return gb_operation_sync(gcam->connection, GB_CAMERA_TYPE_CAPTURE,
|
||||
ret = gb_operation_sync(gcam->connection, GB_CAMERA_TYPE_CAPTURE,
|
||||
req, req_size, NULL, 0);
|
||||
|
||||
kfree(req);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gb_camera_flush(struct gb_camera *gcam, u32 *request_id)
|
||||
|
|
Loading…
Reference in a new issue