diff options
author | Maximilian Luz <luzmaximilian@gmail.com> | 2022-12-20 20:56:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 13:58:32 +0300 |
commit | 50b3cdf8239b11545f311c4f7b89e0092e4feedb (patch) | |
tree | 6ab9a0cf88caa745f651b0e668048c383c80f9ef /drivers/platform | |
parent | de76fc134f74fa1005b7de2bf3841b503ad1d971 (diff) | |
download | linux-50b3cdf8239b11545f311c4f7b89e0092e4feedb.tar.xz |
platform/surface: aggregator: Add missing call to ssam_request_sync_free()
[ Upstream commit c965daac370f08a9b71d573a71d13cda76f2a884 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/surface/aggregator/controller.c | 4 |
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); |