From nobody Wed Nov 27 04:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1701105118; cv=none; d=zohomail.com; s=zohoarc; b=i/gVpZvLWHZ1nhLi1Gv7Dh5BUh/VhcrWeo3jiWBDFe1HqEL5yjpQF2cN0rsSYI+P2a3QFNm8obC2rTUCwD//U5WmSP6ULgYQ6+HsAWHrXfFHiyBaneOfcdIyuQff2CB9eZHcyWunFUaCT+DsqXrkXKBki5PO02CGbSJKrP81reg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701105118; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VSnQX/38IwFzIkR+hMTwUicJZArqSWcbr4ZMRYvD5BY=; b=bOH6vL4wOnfGkB8jaqXPltXWTnHIy5EBZlT+ldsDqexQUSOAcmPNv4CmW37ot7ye2No8L9quttTNEZaXBBLg/zrk1ZWw2kboDUvAzZ3/QHzjsCzkoVOL4rowgy8U6/r4Xvv8srX/sMk5+Cjq28c1VpQWK4/j8h8A3FnWzCJXtUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170110511850513.426953347114932; Mon, 27 Nov 2023 09:11:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7f6D-0007WM-Ql; Mon, 27 Nov 2023 12:08:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7f63-0007Sb-JT for qemu-devel@nongnu.org; Mon, 27 Nov 2023 12:08:35 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7f61-0004dj-9Z for qemu-devel@nongnu.org; Mon, 27 Nov 2023 12:08:34 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40b427507b7so12741075e9.2 for ; Mon, 27 Nov 2023 09:08:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fl8-20020a05600c0b8800b004030e8ff964sm15353216wmb.34.2023.11.27.09.08.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 09:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701104911; x=1701709711; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VSnQX/38IwFzIkR+hMTwUicJZArqSWcbr4ZMRYvD5BY=; b=rhMUlqoEdFFGmU1/to256yLyud9WNgJ7p6ROHKvXALTWU2laNm9oMASpYjSXZMZKyg 2o/GMmwjdhVoJOOU5+ILTQULb2jRXTa2dqd3/s3YBJZ/JmrssoNyNE2avRZBKvRCW6JE tcIxO5NPB3CB24gnzadA2v9JckcWbBTa068lYqZCEk0BaSH7VN3F8RIpQ97OU+59PK+K rqaH58IOogSZctUv25yvs8u8X3Yy2CMCXFZN7JJSatXNdZab7i8Ny4WqHMxaglfatsYN W1YS088jx15UN0H9LaAE0mI7DVi2PVCMVnjtQjfkwYM95Kiez2LFXiAn/JdZ6v+mte71 DVEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701104911; x=1701709711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VSnQX/38IwFzIkR+hMTwUicJZArqSWcbr4ZMRYvD5BY=; b=CX48ypNMHG0bsKCds01VGNXQFJTJRuSAq/0Wunja3k25uBAsULwKwolF8RMuG6td2G LrMMditP1IH39Zxgwjt/CjC9iaOoyJ7AumrQmQXHllY/3aSF3irhH+GUQVuO4lGDCj1v lRJFr+7VIQhPc4oAwcQk6BbdSHaCfFStOR59XsAEI+ewOWu+FyQbCJ0F1vEoiIdwBI7G OLlaMrXBzhz09vg+AYgCB6bNviUF+pMxq882GTxVQrpEIP43Elmgup3Nw7ZRWpJdWm6W HD3sC1CnK8zNsBx/3bYt9eb+jnOCwE2YmhGhW4Q+CUWNy6i+nyCr92ymOSCFlCafiCey TaWg== X-Gm-Message-State: AOJu0YwfD3SNWmGz4DGaRAgIOF+3z5tbXkxZmXJhh4rj8bD0/ntQjPBK PGWSS99Qg/jLm+5ifuOSxCptGwQ+FCaP51ypL08= X-Google-Smtp-Source: AGHT+IEwxhzwsyGSVN7pY2EVQuoIAKsonm2kqCrh/byTAyeszfkdF85ds6vTdQPR8j+Bxx4MlhpceQ== X-Received: by 2002:a05:600c:4ed0:b0:409:5bd2:aa00 with SMTP id g16-20020a05600c4ed000b004095bd2aa00mr10374989wmq.41.1701104911131; Mon, 27 Nov 2023 09:08:31 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/13] hw/input/stellaris_gamepad: Free StellarisGamepad::keycodes[] array Date: Mon, 27 Nov 2023 17:08:20 +0000 Message-Id: <20231127170823.589863-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231127170823.589863-1-peter.maydell@linaro.org> References: <20231127170823.589863-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701105118842000001 From: Philippe Mathieu-Daud=C3=A9 Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit a75f336b97 added: DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, keycodes, qdev_prop_uint32, uint32_t), but forgot to free the 'keycodes' array. Do it in the instance_finalize handler. Fixes: a75f336b97 ("hw/input/stellaris_input: Convert to qdev") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20231121174051.63038-7-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/input/stellaris_gamepad.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 06a0c0ce839..9dfa620e29a 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -63,6 +63,13 @@ static void stellaris_gamepad_realize(DeviceState *dev, = Error **errp) qemu_input_handler_register(dev, &stellaris_gamepad_handler); } =20 +static void stellaris_gamepad_finalize(Object *obj) +{ + StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); + + g_free(s->keycodes); +} + static void stellaris_gamepad_reset_enter(Object *obj, ResetType type) { StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); @@ -92,6 +99,7 @@ static const TypeInfo stellaris_gamepad_info[] =3D { .name =3D TYPE_STELLARIS_GAMEPAD, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(StellarisGamepad), + .instance_finalize =3D stellaris_gamepad_finalize, .class_init =3D stellaris_gamepad_class_init, }, }; --=20 2.34.1