summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Luz <luzmaximilian@gmail.com>2022-12-20 18:56:07 +0100
committerHans de Goede <hdegoede@redhat.com>2023-01-12 19:12:02 +0100
commitc965daac370f08a9b71d573a71d13cda76f2a884 (patch)
treea4a753a86f55102f138c92b017b489d1be4598fc
parentae0fa0a3126a86c801c3220fcd8eefe03aa39f3e (diff)
platform/surface: aggregator: Add missing call to ssam_request_sync_free()
Although rare, ssam_request_sync_init() can fail. In that case, the request should be freed via ssam_request_sync_free(). Currently it is leaked instead. Fix this. Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20221220175608.1436273-1-luzmaximilian@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/platform/surface/aggregator/controller.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c
index 43e765199137..c6537a1b3a2e 100644
--- a/drivers/platform/surface/aggregator/controller.c
+++ b/drivers/platform/surface/aggregator/controller.c
@@ -1700,8 +1700,10 @@ int ssam_request_sync(struct ssam_controller *ctrl,
return status;
status = ssam_request_sync_init(rqst, spec->flags);
- if (status)
+ if (status) {
+ ssam_request_sync_free(rqst);
return status;
+ }
ssam_request_sync_set_resp(rqst, rsp);