From nobody Thu Oct 30 16:32:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500921271528939.289141075308; Mon, 24 Jul 2017 11:34:31 -0700 (PDT) Received: from localhost ([::1]:56336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZiBY-0004zi-5g for importer@patchew.org; Mon, 24 Jul 2017 14:34:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZi63-0000D5-DU for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:28:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZi62-0004tE-Is for qemu-devel@nongnu.org; Mon, 24 Jul 2017 14:28:47 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:37455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZi62-0004sv-ES; Mon, 24 Jul 2017 14:28:46 -0400 Received: by mail-qt0-x242.google.com with SMTP id d10so1059506qtb.4; Mon, 24 Jul 2017 11:28:46 -0700 (PDT) Received: from yoga.offpageads.com ([138.117.48.223]) by smtp.gmail.com with ESMTPSA id t57sm9033799qtt.18.2017.07.24.11.28.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 11:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5OpfPPEOYzhm/3tPM2HzXllTxulVPNmJ+4qRtkXYT18=; b=LH1LyckG0thoj7kk1jByhH65uJaTFa/dd5yM04+yckzcIzd7bbnQP0/P8t15DJ1XpZ hb9i8eLB5u8O1MukSyIdqyZOh/SdfMm8wV46fXPzRSbuOnC4nQ8vc5NMwgPUwzFo+hCI zvPphIxQMQkoELrbPF3PACwjvlLkPXIvIYbuiO8xnhzXurHdaTDAoNJroxwwr3ixdqYu FA9VOQxPP4+bZjdTEvSSLd7QdD/qPMpNArieqTjwsdlngE2Jn0dPm2ACIVA/viU4ba4g DQyj2V/uKRFmqfB003YiCM8ataX1nzc+9g1L930Srkmh3P01Z1ZYa4Erea3KGb+GVL8m gEsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5OpfPPEOYzhm/3tPM2HzXllTxulVPNmJ+4qRtkXYT18=; b=YN91gQjpaLUc0Zx+YBkUc8xBANWL6bSSZVAKSlC2dDEH5qorKX6DS2QvPNAYkZEjRB 16PChFDNuBW/30l4B/4IZ1pHgy98AfwWt9aYAVs6Pem0/59Gp9ODLkIT7cgBQgoZArzs sIjcksnv6UmrjTZrkeiuOyHy12gaKh7boryz6JoJ66fvvD8qEY2f1ipfO6XWpmOeHFGc a5x8eGmRNXYuP37dBbqn6WW1WnPSdj1SjZeoglqHdhGs2WQuvjnahyQqKK7SUtjcvSnJ 0fR/kniYlPtktvCZbDtG1UjWqLSD4B0tZdCwZ2QeRXGqjGiMALURml00pMb6yN0TBanw rKBQ== X-Gm-Message-State: AIVw113Ub1BIKsklcJbiQjexCjhmjJLTRqoCxhdaXZ68wvc5diuRYu8D dE/JOrOTvNJMxA== X-Received: by 10.200.52.138 with SMTP id w10mr21720259qtb.77.1500920925897; Mon, 24 Jul 2017 11:28:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Alex Williamson Date: Mon, 24 Jul 2017 15:27:28 -0300 Message-Id: <20170724182751.18261-13-f4bug@amsat.org> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724182751.18261-1-f4bug@amsat.org> References: <20170724182751.18261-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH for 2.10 12/35] vfio/platform: fix use of freed memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 free the data _after_ using it. hw/vfio/platform.c:126:29: warning: Use of memory after it is freed qemu_set_fd_handler(*pfd, NULL, NULL, NULL); ^~~~ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini --- hw/vfio/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 7c09deda61..da84abf4fc 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -120,11 +120,11 @@ static int vfio_set_trigger_eventfd(VFIOINTp *intp, *pfd =3D event_notifier_get_fd(intp->interrupt); qemu_set_fd_handler(*pfd, (IOHandler *)handler, NULL, intp); ret =3D ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, irq_set); - g_free(irq_set); if (ret < 0) { error_report("vfio: Failed to set trigger eventfd: %m"); qemu_set_fd_handler(*pfd, NULL, NULL, NULL); } + g_free(irq_set); return ret; } =20 --=20 2.13.3