mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/surface: aggregator: Add missing call to ssam_request_sync_free()
@ 2022-12-20 17:56 Maximilian Luz
  2022-12-20 17:56 ` [PATCH 2/2] platform/surface: aggregator: Rename top-level request functions to avoid ambiguities Maximilian Luz
  2023-01-12 18:12 ` [PATCH 1/2] platform/surface: aggregator: Add missing call to ssam_request_sync_free() Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Maximilian Luz @ 2022-12-20 17:56 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Maximilian Luz, Mark Gross, platform-driver-x86, linux-kernel

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>
---
 drivers/platform/surface/aggregator/controller.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 
-- 
2.39.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-23 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 17:56 [PATCH 1/2] platform/surface: aggregator: Add missing call to ssam_request_sync_free() Maximilian Luz
2022-12-20 17:56 ` [PATCH 2/2] platform/surface: aggregator: Rename top-level request functions to avoid ambiguities Maximilian Luz
2023-01-23 15:40   ` Hans de Goede
2023-01-12 18:12 ` [PATCH 1/2] platform/surface: aggregator: Add missing call to ssam_request_sync_free() Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®