From patchwork Wed Oct 7 09:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9988 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 354C3BEEDF for ; Wed, 7 Oct 2020 09:23:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AF52863C13; Wed, 7 Oct 2020 11:23:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nfnGlh6V"; dkim-atps=neutral Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AAD0C6035F for ; Wed, 7 Oct 2020 11:23:22 +0200 (CEST) Received: by mail-lj1-x241.google.com with SMTP id l13so1233729ljg.10 for ; Wed, 07 Oct 2020 02:23:22 -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:mime-version :content-transfer-encoding; bh=4V2i6L2nkUl5kfyEdjUktK9rgnrR+tdhx5llmPlWigg=; b=nfnGlh6VdXRXbU+Dir5r9ecfxYKjPl1D9wZRwggQPlsogxlF6lbQMDX8C28JWIEitn MX85XIUEC4GwBhgK2A4ax2xIVjR8F2MP9AO+CAp3FuArTi+jPVbQceGXY3Eg7HyeGhOV oYtiP9LR+Qp2E3AkUYPV19tL+OYHcvB+IzcGPsrsg5S4H/qspaTOErYL1wyEtX2v67pE UDBPe6Dnrv6x9a7YGJLez7p8TZWeeH/TTU3P7bs9A2RIZm/piuOtqbOjXqUGB9Gobwc0 Yx5fK7tewCLXCJ5mOK1kHF+LVkllhDPKIO4qpt2vgTQtdHwwKmLcVbeUZVjnVpdbcEuy Jvsw== 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 :mime-version:content-transfer-encoding; bh=4V2i6L2nkUl5kfyEdjUktK9rgnrR+tdhx5llmPlWigg=; b=prqXwpzA3S+T9lUhOeo2aixatLMfzKZEhk6OLkCq791FULJwp6545nATNAE9LfsMq3 bnj9zy9/XTLYyTYoh1yhqyZDctoU9SweOGV0rq8jkZEIqaZ8Fmp96npzcY0glLg6n4eQ i4FISmqZquah3yhJFtI7D9eM0nvioRGKNGE8cx59ehAMs7+n7YdqgzFkDezVKnAiiQTW cCj/EZNVACj2J1DRFIkxhzuhzBZxZq11CgsvmizcM64fmBa1d6rUpJ7Ca7K1Y/90Vj54 SGLDibVS2BJNTIbaWy1WLtSKBh2VDPOs1VPTUn3uf0YTQhHPtPMjKKWtFjQRGWVzxOL5 gOYQ== X-Gm-Message-State: AOAM530iSJNtlHkfJPwxfcW98lJwsonu/WCjUn9tlx9zDRVLJhiZgDtJ 8THMxn57ny3Hf8MbR74DXoGtptCslxxK9A== X-Google-Smtp-Source: ABdhPJxjLQnY3ydXemTnMvkWPheeQHV2dKncyVIy+Y6A42r8mJNCho4NPICvdjDwTgahqjYCpx4c7Q== X-Received: by 2002:a2e:8942:: with SMTP id b2mr910368ljk.441.1602062601890; Wed, 07 Oct 2020 02:23:21 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id n26sm258341ljg.133.2020.10.07.02.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 02:23:21 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 12:22:36 +0300 Message-Id: <20201007092239.41704-1-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/4] cam: options: fix access to uninit variable X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" operator[] doesn't check if the option exists in the values_ map, so it can return a pointer to location outside the map. Fix by returning an empty OptionValue if the option is not found. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham --- src/cam/options.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 77b3cc1..8fc1c42 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -61,7 +61,12 @@ bool OptionsBase::isSet(const T &opt) const template const OptionValue &OptionsBase::operator[](const T &opt) const { - return values_.find(opt)->second; + static const OptionValue s_empty; + + auto it = values_.find(opt); + if (it != values_.end()) + return it->second; + return s_empty; } template From patchwork Wed Oct 7 09:22:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9989 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 80125BEEDF for ; Wed, 7 Oct 2020 09:23:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2C63C63CE4; Wed, 7 Oct 2020 11:23:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OuBrqusr"; dkim-atps=neutral Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A6C163BE4 for ; Wed, 7 Oct 2020 11:23:24 +0200 (CEST) Received: by mail-lj1-x241.google.com with SMTP id i2so1257864ljg.4 for ; Wed, 07 Oct 2020 02:23:24 -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=6kKV7YEXI6qyoTEnYWzHE4s/UqGs0UDDvFH9N2jy44Q=; b=OuBrqusrgXQ43Juv9DtWwQAOCJL6IFmvNj90ASSnSyMXtHPB7y/f5AZ1yoFdDWUAlf XN7Wr6HrqbO+VdqhZVqn8vHKKAZKDgDPF3HDc0m/YgCUZRWMkjY9Qn80FHrx2qp29Td6 wQZOgOLNc9fE6dsE2M3PuUsvSsyadGpxbCiIdmpHnqkYxPSgeVArD7altTlOr1pp+55x UGzrfPM7u94P79jL/HBaLU9MrK2SlR3nFmwP02v7VmNjTBJFr0Htr/9DnxMGqlTkk7/X 7Z3F1BQ3zfT6yCwjhsJMWOFYtwIfJCIbE2XLBV/zwlL4DaxyWTjvoW0OY/h9Ee0O8YWw 4Gvg== 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=6kKV7YEXI6qyoTEnYWzHE4s/UqGs0UDDvFH9N2jy44Q=; b=QfD4nOQAxl8b8mty7215PeUvDP7QdPvcSabPk170jWAuye3mevsziOnKO8Epj9TViU f0v9JkPLrJ51MFWDnNDAV/+FrOSA+KpMf7TKW0n8k1HLDN2UlCZTe83+mff6F4penFbB nAuONEZuFkpRmQhVV+biyhOJxhz5K/BrU+jbXTMWpWjUMGLjQvZSW9OIhqeLgPmEXh+w Pc8na7mrP2zoWhAE8czDDr6+5jpG6cq+IdqDTq5sAZjRJq1HwGwdtkR95NnJjiIwhRpa D85Zc6t9jibb0ofDaqpfa/xNAvLLXG0u+8OnHe6te2ZaQgcuaN6hsJ3naZJGr2DpkWWc udrg== X-Gm-Message-State: AOAM532DnuyyY1C9h9RajLDUblvgh5xs7kDtzqgW1btK2YIrXqpxlx7g dk5MCK+deeielP6Z9Fwf/Aaat0100Aa5pw== X-Google-Smtp-Source: ABdhPJxO34irAHAuOZO/tVSofO96+SwlvBIFxxaNegLQH3YnHXeA91Zslf/xuht1+6tXutQK3GGfNg== X-Received: by 2002:a2e:2e19:: with SMTP id u25mr780107lju.349.1602062603704; Wed, 07 Oct 2020 02:23:23 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id n26sm258341ljg.133.2020.10.07.02.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 02:23:23 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 12:22:37 +0300 Message-Id: <20201007092239.41704-2-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201007092239.41704-1-tomi.valkeinen@iki.fi> References: <20201007092239.41704-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/4] meson: enable no-psabi for gcc 9+ X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" I get the warnings related to psabi with: gcc 9.3.0 "arm-buildroot-linux-gnueabihf-g++.br_real (Buildroot 2020.08-24-gc5c5f1fa46) 9.3.0" Remove the check for gcc-9, so that -Wno-psabi is used on all gcc versions over 7.1. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index dd88eea..16f1c6f 100644 --- a/meson.build +++ b/meson.build @@ -75,8 +75,7 @@ if cc.get_id() == 'gcc' # passing on ARM platforms. This generates a large number of messages # during compilation with gcc >=7.1 until gcc 9. Silence them. if (host_machine.cpu_family() == 'arm' and - cc.version().version_compare('>=7.1') and - cc.version().version_compare('<9')) + cc.version().version_compare('>=7.1')) cpp_arguments += [ '-Wno-psabi', ] From patchwork Wed Oct 7 09:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9991 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 45996BEEDF for ; Wed, 7 Oct 2020 09:23:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 131E463CC5; Wed, 7 Oct 2020 11:23:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cJF6sRpv"; dkim-atps=neutral Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 41BB663CDC for ; Wed, 7 Oct 2020 11:23:26 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id y11so1477119lfl.5 for ; Wed, 07 Oct 2020 02:23:26 -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=ASlDfRmcZux0WTHlF7DPWJ5JOUsvv/gtOF0gl+qrgJI=; b=cJF6sRpv7BaZglHd6wSngOi9ppQFlXOh9C0k1il12Im+PjXZXSpac2oP5Eki9AnvBv Lqdz7FcPM1q61xv2HUtZEOmVB1bV6C/3Pd3b0RIKD+tJANtzMRGYoRO9GlKUpttL83g4 46kgHM/XW2bsoBcwJhBlmz4n0iJFoEQsaiWXHa4s/yTiPC7c/R2q1TxhI1c/oIcrzCM0 yATuH8tzR8XzpxbbJz8qT5rDH9tByZ+pM2zWVrvAiPhW2WjPYd7nuu5Hxvi+I0nfY3wD LsXvrslqmxepkTKUfQ52SVh4o22jI2vRUwLiqyQQGs7oGu/AJ1CIXXtzd2kUvCCXICXr KJng== 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=ASlDfRmcZux0WTHlF7DPWJ5JOUsvv/gtOF0gl+qrgJI=; b=Xgx3/2hAXTDf8WOVQjg1TW0ABBS2nw/WF99nPyu9sHo9b2unSuB7L57PuvOCXDMtv5 LKTwuufurJHeaxGKu0Mhtn1wYyt+WR71Y+KnsWpXvz5PUw27jjg1r54+OqJv4lRUwg+T sviNjZLuMfbKbQn3JQ3nG3iEstMWtI+q0pBndJoGZKDOhPpPtKRuG7Rcjumz1oCSPfjd cvpovN7JKYR/wqfeakaW3kulQfKcJ2sInK3tlHe4EShquulgjI3g7kZjOfcxh4Tm+Pc1 OXbzPuZR6TcDscJuaqI9Gu+Pe8G7hIhlVRkhZLpzCZcse/mCSicIV4lbXo6ZupF1lsBI ndbg== X-Gm-Message-State: AOAM53028tCnKI+blrL+JoolOTyfCjULjeNg49fxM9ahM3GrmgX2fZmg AwBHQ6Cfj4dZenf89jb9t+F5mbypu4is7g== X-Google-Smtp-Source: ABdhPJxG8UCejirYznb2qNBS6RMx58yyMihVKuJ8pqs5yg2OaWY0xQ0K6wpITNOAriFZKpEmAt7OFg== X-Received: by 2002:a19:8c52:: with SMTP id i18mr641842lfj.115.1602062604484; Wed, 07 Oct 2020 02:23:24 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id n26sm258341ljg.133.2020.10.07.02.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 02:23:23 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 12:22:38 +0300 Message-Id: <20201007092239.41704-3-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201007092239.41704-1-tomi.valkeinen@iki.fi> References: <20201007092239.41704-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] cam: fix use of uninitialized field X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Initialize last_ to 0 to avoid uninitialized use. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/capture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp index 5510c00..995614a 100644 --- a/src/cam/capture.cpp +++ b/src/cam/capture.cpp @@ -17,7 +17,7 @@ using namespace libcamera; Capture::Capture(std::shared_ptr camera, CameraConfiguration *config, EventLoop *loop) - : camera_(camera), config_(config), writer_(nullptr), loop_(loop), + : camera_(camera), config_(config), writer_(nullptr), last_(0), loop_(loop), captureCount_(0), captureLimit_(0) { } From patchwork Wed Oct 7 09:22:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9990 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5BFDDBEEDF for ; Wed, 7 Oct 2020 09:23:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE56063CE5; Wed, 7 Oct 2020 11:23:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J3fyom/a"; dkim-atps=neutral Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E2B9163CDC for ; Wed, 7 Oct 2020 11:23:25 +0200 (CEST) Received: by mail-lj1-x232.google.com with SMTP id 133so1270524ljj.0 for ; Wed, 07 Oct 2020 02:23:25 -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=6tdlQlbPp1GAElnJIvX3oIIAHk6QbyrOu0AkYBVPwpA=; b=J3fyom/abb6YotmXW/C1M5IKrQXjZynckhcREoql6UhOmUsBuUCsUDpPrT5iixiR/o 4jIQ+HgpNWCRPty8I84l9otF7Le0KsClx9LLVtSKilICAPSZyBuzuuQqAJmSNbMMVIGn y5M3dnxOp2IoWDqUb3wr7bM2VXkb5+magibL98XLdEjslq3rNt1ZJVZoLXmp+j7eahb2 R6cMY18AsuzA3+cBvsvduc652qej2ncuaHyLyqP46hJBL0+NMQ5gUGiOkdkU3ecAQnWA MZ9PrdtrMa2aq0JggfK9l+/LpBzd6atwnN2OsxY19jM2PAoEjFLZLEsQAyPg2Qafz7c+ IVeg== 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=6tdlQlbPp1GAElnJIvX3oIIAHk6QbyrOu0AkYBVPwpA=; b=Hb5B/FmGaeVYINAw5s84p9SX1w6a5u7EMbVDlqK66c5Z7YSX+zXE2ONOsaaAVbuQO/ mpPsF0kNfnldoMX8rkNqqAfW3mr+5bVtJeO2gPrdqCaU5WwflGEzXTB9uQPgqitTxGWv wk6VJlLEh6VK2L21YCO/30GXXX0FIEJ+0BoazBP2JO9fgAgrXrFUQ3P2FVN257P0wfaw T5mjAzFgL6Q0tuveVcxBT7ASTWmOHSv6qBXTF4XoaNxrrj1DT1ew85HRVgWatUaMG8Hm tL9lZOr8wcyY6Jzj+mmgXVU6GEb1Sek0C5Ld9DPUTUG1Iv0kjwExAhZFwnzq7pvtEzP/ 9Orw== X-Gm-Message-State: AOAM532RiyMRUrL9RpqiGfVJdRE5aTo2iJ96n7AyKPBt1JqZV2mLXtjl +raUMeKbTyMEf9UN1Cs09fifb8zczAHboQ== X-Google-Smtp-Source: ABdhPJwCV4arsLR9cOXdDGI9i2UKV60JwDoGgPqljpgfDyHBpiK3KkOmTf62ZtsiagM+/9tySX935w== X-Received: by 2002:a2e:e1a:: with SMTP id 26mr776249ljo.377.1602062605254; Wed, 07 Oct 2020 02:23:25 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id n26sm258341ljg.133.2020.10.07.02.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 02:23:24 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 12:22:39 +0300 Message-Id: <20201007092239.41704-4-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201007092239.41704-1-tomi.valkeinen@iki.fi> References: <20201007092239.41704-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/4] vimc: fix close(-1) X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" ~IPAVimc() checks if fd != 0, but it should check if fd != -1. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/vimc/vimc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index ef25776..372a15f 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -61,7 +61,7 @@ IPAVimc::IPAVimc() IPAVimc::~IPAVimc() { - if (fd_) + if (fd_ != -1) ::close(fd_); }