Message ID | 20210724150605.567038-2-festevam@gmail.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBDULZYNR2QMRB26Y6CDQMGQEZK54I6Y@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::1040; helo=mail-pj1-x1040.google.com; envelope-from=swupdate+bncbdulzynr2qmrb26y6cdqmgqezk54i6y@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=gjMtcWpU; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=C57RiFV/; dkim-atps=neutral Received: from mail-pj1-x1040.google.com (mail-pj1-x1040.google.com [IPv6:2607:f8b0:4864:20::1040]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GX8f63JVgz9sXJ for <incoming@patchwork.ozlabs.org>; Sun, 25 Jul 2021 01:06:21 +1000 (AEST) Received: by mail-pj1-x1040.google.com with SMTP id s4-20020a17090aba04b0290173b4d6dd74sf5158683pjr.0 for <incoming@patchwork.ozlabs.org>; Sat, 24 Jul 2021 08:06:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1627139179; cv=pass; d=google.com; s=arc-20160816; b=TsktRPMgOQNNCEZHPWR7Q0Aw/mMpTZlneYeNyUTFbf6ABLDmObjWJbSVXyGpbw+GXv rxWhriS2rLVw++M2Y2NoAlbENYjdRTTZNJrAjGMNAVOZ9j6vsC8LtmIiZYxfYTXcpCmB cQbj4JlM706kqXk9NamUfsS6fxspipFg6EI4HPy+2Agac+w82xZ2kyeCJ7CaX0j/RdD4 SIGDEnoOsnlhMeZiKJ8WdlfQLXSFXOSpkr4XfLlPKhB4jWJ9sO0nzo3nlfabReQeMSn4 OMcrX8VTc4uLf7tZU++JCwqEjQ5eqnYgDKIqObXiFh7i2HhWZvxFjC4SIMZWXnj8LBOi Hu2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=OQ99Xz2UkSM0SQ/rB5cTjB6uKKKyHSNNhsh87rXDFSA=; b=qa5HlfhZixUwCjdSvs9tB2Xzr+tQgvQkgn7s/IFUBPK2GYbK4R100TgWSGNcAAUWOL L3jADFYdfcQPoQacsM1pH/8vLrFUfiVEpSbDq8AQWerczgh7ZgxTk1gxx4CpBQzlxSdt 91UGUHsD9ObYKREd3gVyZ2llU8hkc8wKIYRVvZezlhOqTPRIByEh+tWSYZoYsY5274m8 YqaO2WmiIDuaUVi/n6hLs30H7/jeG4oyJcOH2AzQQfQhJhB973qnVvQ6WWU695bJd/mT hI1PhrDxJA7G/yQYI3OCl95zXZmotqXijxwholkkw7JVwIcxQcbWLoh7nxzdkMH/QXUS UXsw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LrxUO2N1; spf=pass (google.com: domain of festevam@gmail.com designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=festevam@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OQ99Xz2UkSM0SQ/rB5cTjB6uKKKyHSNNhsh87rXDFSA=; b=gjMtcWpUUEgNcI+UpOJXRjLxFh94ETaY9uOlXK2N2zv2K4/M3IQqXh8mGxWyltu6/J mR1chaeCJYmEvU/723wF0Nf/Gqv+KMZ/pdjjHbkxBEAku3oNLA9IxCUIDSEpBt8akBDV UjDwNM7JTVdH/IkPGs9TBk6HzYh/d1VHxK3+xqgEogTUMtHRXwl8bs4YAsYIeYM/vL8V YH80saZginiwNHaLGrJcosdUwBIniqEIdj8pVimuJ9rPYFlC3vo5OXm1RLFE50HkahfG RBce+/veTU2nCiqFHcYT8h6chmsME1R//P2LabY9fAs6xqxHdqLliJSCKUhRXvJHkE1m mYHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OQ99Xz2UkSM0SQ/rB5cTjB6uKKKyHSNNhsh87rXDFSA=; b=C57RiFV/yYtlpikVz1dpzrgux4TZdA/PLMvq5oOIeZOyJiIACVFaMUt08lQlyw5sv2 VO+NP+0wdANGvlcbk6dvwUSnI3UCurQWcnCiKsD+n98aNJioXbauLijjfCaGJAH/D5DZ J4uFk60oiCUHlfrrtM+GMBQ8im1ECo8ZFzU+n64/ski6AJ061cRg4J21O1p53iyuiWCJ 7e4QKA885YQNEQ3tPYV4kN9wNJRDyUY+oLJnFBtxIcyUWNLDM5nFwtIIqE7W/ABKxDbh Y3VagOWRlaGiIrj+sMksMY5OaXlU9Wo4oKMB2vMp41GVLwkh4UFFsHem5ypnOJow/Qcu yYgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OQ99Xz2UkSM0SQ/rB5cTjB6uKKKyHSNNhsh87rXDFSA=; b=abXsca9l1vyJj+iCQqNsDvTPOp1RY+j+bLia0oL5YKGPDL8inHxBWhWpaNwwfbA5a6 ONEYZUIfIAT0+OI5EOr9WgjL3cje+C5/I0AYiUMs7IWlavG4VFgSg4Ue4JD2M7e9mGYj MrXAbHFu37FolCTLwW6A+bU3AHLcBJ4+f+LF8QpJfmRCtRrVGHO5Hc4Wth1ce8eq2jCM A4JsAMpjStdLYmYYgcz8YKNWhNHTz2sm6VQe0sohvGob2RpMCRAlJZ2FFmfSReGrn3Q5 +x5UCmpHZAqiVv8NYGy2w3hFOd3eOsKwk/JjBar3kMTcGQGrzSHNHHcA7frng504k6JL kZxQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530afWV2P+FSLCbBDZpB838/mHJCVMkNxXZkGcgQfvGngBFTTHfg YPwxmPOJ2MXFOdT/O40U3y4= X-Google-Smtp-Source: ABdhPJxCeh6u8a3L6CnHD+8B6lQgoQsyMcrDF+to4KV2u3Acua8yMjhxOa9Bd9ClT+TcpuEhz0Ufkg== X-Received: by 2002:a62:804b:0:b029:328:db41:1f47 with SMTP id j72-20020a62804b0000b0290328db411f47mr9492022pfd.43.1627139179785; Sat, 24 Jul 2021 08:06:19 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a65:6487:: with SMTP id e7ls6336849pgv.7.gmail; Sat, 24 Jul 2021 08:06:19 -0700 (PDT) X-Received: by 2002:a05:6a00:1786:b029:32c:c315:7348 with SMTP id s6-20020a056a001786b029032cc3157348mr9622895pfg.42.1627139179100; Sat, 24 Jul 2021 08:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627139179; cv=none; d=google.com; s=arc-20160816; b=tlBV5vUr+yqvyeO7+nsHU29w/RCCF0xMFhllxRoBTNVfGLXOdOofjUV7K7u4dzf2pM uR+NBZQyacok5KNgfWrGsK4fUAfpbMg9VboeYKtX/wE2Gh4Hm7mIiavsrB1ydsBWECOn MfgUhV/ZKTguvNHRLwiyJPVcP1CptZW6ZR1Z7F17f9yZDqkFGTjKUvJFF5X+59ZkJmwK Kp839hL4lyf72pCmULTK+ckqrQOaq9fN1GlU48wMUlPCq3lyWLRAxrvykpzJ4cG+xwH+ wZtgvhMqinS1Km5qlayn3++er+hbH45vOcQReih7TYMf7y2RSnXmuQI8Wc9yF9P7wAJw 3Kwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=IGYCbxQzUMAd4W9uDAEYljg4Gp+16hmBJ4we3QuS8Kc=; b=g4pey1+orjyCh2Yi4OesxI3Jkiu9YEaJVOiv03hHRnlkEeRMNexGXkw2KucR/09IQS KLdInO24X/ddZLLHWJtERGZLokSUU2tfsId+JxAR3A3QEh5ib0bCwsLBtWmxHcrt9SsG +dUN4vwyMyAxIZAscE8FGsVqMbZvR6TuyZPF+xoBFX5mKaj+Gk2JNk0j4mCcMd0zVBlz iSqxVcNStEG+S7DfsbiUq95ZjPkG/OBLSE38nHhdYMgKBeZwiHQLYTOJGruaiQAJl2gW 39FxuiBYT7O4dx6LqtcIb35lfGEQhmUmoLnxzMAd+NLBBoCwP3fmht/9BJk/vREe9Mbt SmOg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LrxUO2N1; spf=pass (google.com: domain of festevam@gmail.com designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=festevam@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com. [2607:f8b0:4864:20::62b]) by gmr-mx.google.com with ESMTPS id b15si3149311pfl.6.2021.07.24.08.06.19 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Jul 2021 08:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of festevam@gmail.com designates 2607:f8b0:4864:20::62b as permitted sender) client-ip=2607:f8b0:4864:20::62b; Received: by mail-pl1-x62b.google.com with SMTP id e10so6664291pls.2 for <swupdate@googlegroups.com>; Sat, 24 Jul 2021 08:06:19 -0700 (PDT) X-Received: by 2002:a65:690f:: with SMTP id s15mr9821336pgq.21.1627139178504; Sat, 24 Jul 2021 08:06:18 -0700 (PDT) Received: from localhost.localdomain ([2804:431:d77f:26f1:1bce:1fc6:1476:4c5f]) by smtp.gmail.com with ESMTPSA id ml9sm4863942pjb.53.2021.07.24.08.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 08:06:17 -0700 (PDT) From: Fabio Estevam <festevam@gmail.com> To: swupdate@googlegroups.com Cc: sbabic@denx.de, Fabio Estevam <festevam@gmail.com> Subject: [swupdate] [PATCH 2/3] boot_handler: Check for openfileoutput() failure Date: Sat, 24 Jul 2021 12:06:04 -0300 Message-Id: <20210724150605.567038-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210724150605.567038-1-festevam@gmail.com> References: <20210724150605.567038-1-festevam@gmail.com> MIME-Version: 1.0 X-Original-Sender: festevam@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LrxUO2N1; spf=pass (google.com: domain of festevam@gmail.com designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=festevam@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/3] stream_interface: Close the file descriptor on failure
|
expand
|
diff --git a/handlers/boot_handler.c b/handlers/boot_handler.c index 4e14135cc0a7..e476c41db928 100644 --- a/handlers/boot_handler.c +++ b/handlers/boot_handler.c @@ -48,6 +48,8 @@ static int install_boot_environment(struct img_type *img, ret = stat(filename, &statbuf); if (ret) { fdout = openfileoutput(filename); + if (fdout < 0) + return fdout; ret = copyimage(&fdout, img, NULL); close(fdout); }
openfileoutput() may fail, so check its return value and propagate it in the case of failure. Signed-off-by: Fabio Estevam <festevam@gmail.com> --- handlers/boot_handler.c | 2 ++ 1 file changed, 2 insertions(+)