Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4493481rwj; Tue, 20 Dec 2022 10:50:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXsy+OQtRgrsNYXKEWDCBBNGiFzyx45NSy0crzqOE9QYQmOLe4UtvQNGdsvTTYznasdUlQXb X-Received: by 2002:a05:6a20:9498:b0:9d:efbf:8143 with SMTP id hs24-20020a056a20949800b0009defbf8143mr14775424pzb.12.1671562210441; Tue, 20 Dec 2022 10:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671562210; cv=none; d=google.com; s=arc-20160816; b=o6TUC0FWyh3BjfvMj6lmr6xGpw5yl0ZeDI+c6owtRAGk+Uos6PEdCQ77w+dvKjkEwZ HQxfSwcdUXOij4bQS/A8stdUPA/TufOeLqE9psv9VMIZOK+sTu9Or9LmV9eKIci0SLHL nA24pkfUqnsJqArcbkPcbG7qrwi7hJlV6TdudMpFQ6X8mf40wWGcvI2jNRhGtub77tjU 6tb9qaGxl5TZwrOu6YFBxPmfXIVX3HUtHUtM9hrNa0xdM3C0Z+oHO5DczNdTbIJxwwRA +FENxz8H4Jau/gARNZCE414BBpijztTW4J7QqYy704U82KI9Q+ZauluDf3oGMUG9Lc1p lNug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Unl6QfwtHEjfkMdy1Yw/MGc3MT3pIvqz7ripxlsDJwM=; b=k3qCIAFbt/lr96ibu8Vq82bJSfcQSBoQ/7+Q3uckP79bVPgrIvqy17OAQNPu7radyB lVy55Z3ddsKy20xBNjavdGowX9pr7cyLoQShkRwdj62EscB7TgTftCSGvAi5sWXHm7PN ZQYRe5nXCqqmLpYaZL3KYsBBaX38DqauIrsfNxra/kpsoYMjlLgCgsRQc/RnJYwlF3Nv IblOT3svOELtND79m1YtXkGVwuMfAeueraU8QHJA/zL8ypG9+z1lVLV9m4wiWlY2NHka YZMJ5WIfWNXBz9EQuOUMQS55lLBLRzmOQaBqjsicklMTn8mWIJGy03oF2IX11iXcv89n 1ebw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="EJ1/cehc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w191-20020a6382c8000000b00478da14e046si14010870pgd.876.2022.12.20.10.50.01; Tue, 20 Dec 2022 10:50:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="EJ1/cehc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233462AbiLTR4e (ORCPT + 69 others); Tue, 20 Dec 2022 12:56:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiLTR4a (ORCPT ); Tue, 20 Dec 2022 12:56:30 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D51DFDC; Tue, 20 Dec 2022 09:56:28 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id bx10so12570503wrb.0; Tue, 20 Dec 2022 09:56:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Unl6QfwtHEjfkMdy1Yw/MGc3MT3pIvqz7ripxlsDJwM=; b=EJ1/cehcjfRl7EyInh5Z/uLfXOFn4tMBnMQQ6rcV4YHol8i34pvIst2Ahka5JldZaP lgVnL2M95Kx7ZtPmQOiOxQrdK43tDxqmZzIJ812UKMFrrOiNznIlnm/GaQjLBl+/8DV+ ap27LBUVSlFidCzIIR8b7smAgZrmeNOmkjq7ypf+LfWlhNxBaTIX8190o8X7xLv8B/8a KfD6Y/OQ5F/pPuEo5+VmjXfIvpoW0oPYALDh51UTtJeshDp6JLpuALDQKJnj4f513YgC 97yryLVIiNobqGU5OyKP0oScWZiHPoMCcTcWjZSpv5Q8hTni76Fm9/WtO8fwkmWo/hzS Tnww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Unl6QfwtHEjfkMdy1Yw/MGc3MT3pIvqz7ripxlsDJwM=; b=eVRh/+00BlvApbIGihanaj4p3yLmTKHwURf24BOg873Co/DnNst9UBNV8P1aGRj/sU XQp4ajO9eeyzkgKGECO6CT2N3oErHTkEG7I+B8ZbfE3YGw0Lsp9aoOGLLHbO7F/oUFP1 KUnPlvMze5Vn0EY6ZOWEZCRtyuL/niJuHB5Nmq+kTq4BO2lX/ksd4rHmKSw8z/5h+Y98 qqsYFudn3Xc2mTLV8EC87gykyUyK0pWsuWv8hiaueBJxaWB/jmreezJbcWZdOmJXKIIm bOyBQvernTvRR22GupEsy1pOj0PoWPU6ZFrc2ZzxQvrzxPV/e30Cr0Z7Lpy/m21Dr+8n NK0g== X-Gm-Message-State: ANoB5pnoFDUEqwcon/sr2by1yvf5a3JX4JGZQ7cdQW4Me2lucvRGDkhZ c9TfZMpgEzDSl7KZArujMchFfbHihEk= X-Received: by 2002:a5d:40c1:0:b0:242:81da:f3c3 with SMTP id b1-20020a5d40c1000000b0024281daf3c3mr30834520wrq.63.1671558987030; Tue, 20 Dec 2022 09:56:27 -0800 (PST) Received: from xws.localdomain ([194.126.177.41]) by smtp.gmail.com with ESMTPSA id u18-20020adfeb52000000b002423dc3b1a9sm13206300wrn.52.2022.12.20.09.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 09:56:26 -0800 (PST) From: Maximilian Luz To: Hans de Goede Cc: Maximilian Luz , Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] platform/surface: aggregator: Add missing call to ssam_request_sync_free() Date: Tue, 20 Dec 2022 18:56:07 +0100 Message-Id: <20221220175608.1436273-1-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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