From patchwork Thu Apr 16 20:16:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1271893 Return-Path: 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=2a00:1450:4864:20::340; helo=mail-wm1-x340.google.com; envelope-from=swupdate+bncbcxploxj6ikrbg724l2akgqeauseo2a@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de 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=p+G65Pqr; dkim-atps=neutral Received: from mail-wm1-x340.google.com (mail-wm1-x340.google.com [IPv6:2a00:1450:4864:20::340]) (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 4939V80cTmz9sP7 for ; Fri, 17 Apr 2020 06:16:31 +1000 (AEST) Received: by mail-wm1-x340.google.com with SMTP id j5sf305319wmi.4 for ; Thu, 16 Apr 2020 13:16:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587068188; cv=pass; d=google.com; s=arc-20160816; b=081ItkZDQAkGJS5cQUMTij1bDXv2HweaGm7jZZ0qjKJuDH//BFC8g1QF2FCbxefzQ8 +njA15lHvFp4NzegIlz548fdAGy2eYVf+k7aveau3Th8hUl0o+GLvewPKEzSJf1yb5Ur cZlvRg02yPI1ifiVrmjNMpTw7szXQoxFgCvVLOlV7YiSmJug+ldkzFWiRFuAncrDmoqF 7/0HNDOlF+tnHNlBYRe75EsJr/+QfzJwx0t1IeZ6IcIBwh9lhV1WqBll81YO8d5dbD13 nxOc6RLzqX1VkD3DE+J8RCTPUDblp1Cs3u4MVpNyXL/7RHDq3/OwqiUs+jR1IfuIsK1s Wsvg== 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:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=50tf31DF/e14iqzneRkepYXc82jG6V2yBic0uOjQNJA=; b=U+ai+F7oaT6zIOwwgkOI1DQjmZf/TsnNmK5aNJwDQGcS8SNjqRPm1eCa8R7Yu6c/yy 03rueZwmF0vOyZdD5XPlszf1Xpi6Zn2zkD+1SU2fNIVprXwtUck1ndt1aB+jhC4k3bRz 4UpwmQPN9dlSc9Gn5n8UlxuESbqeKkJAO/SlQSPvaxZsX7iL7pxGtpt7R7yEZ4koZGSA zRllpmnFRe68+q13Fugtv8XRWrLwTkXth3w3ogQn3VtucpNEd2IJs+Urw0Wb/NzFbkOo DjfjQteaQgXuJfgvVqpBGIOQ1I0POX6aWGMO0EYaX2Z4pvKpopFbCP3oG/qoj/3rWKDH L/iA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id: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=50tf31DF/e14iqzneRkepYXc82jG6V2yBic0uOjQNJA=; b=p+G65PqrxBbMS4UDp0ZBh1e8Vk4d7kxat4yyEDy6cobR1BX17VBeMUv8eBJ5/U+rkb RC7ZYJR/6lt34grUq6BoI7MyPAplnP/QoWjFFma9f2OSf28FgNt+kz5Lqd5Hr2rMIKYn klWH1Dlvrpq9SQKTmVQSNgwpPT4I4dmCyVukLXe0O2XXIIjg73IeUIz4VIxcWIwKGsRI ivpZ3Hx75Jg3jTjl3F7AL27IvnDyViUlcnvYLUJkqM3wEn0WzHcbOyjOAhFfhMUbwfPl wK3Oz21YhuWWGqr6IR2I+qnh+w0W5K5VeyI8mXOGV06/LwWBJkHzoSpeGAcaFa0ODhZT zzkw== 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 :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=50tf31DF/e14iqzneRkepYXc82jG6V2yBic0uOjQNJA=; b=qvnW2+O+3z4PWQPEimFjglr9odO9DzmIIXn41djG5Ydy5CHYKenB0bSI5+hAdoMVxt A+iJPnlYCcAMzgSuj5vYnmjicEb4ZQAZVwFWlQ8o2vP47iPIghQXJ7HEygyRnf0Ywv/T GiCgcJIvXABJWPydxt+KMq3BDhARh5IntBM+nU1rgAhaO852fjMUqFSGNiIxdXQDCzE6 81p17q2B8MJHHf6Fp5Rcn+7LXOLUoP3r15g9by3kdOlKmzM0MFjyiPDwvOm+WYCjRIyH F1BowROrs0VVZ1TgKwhO9mlYkgSpBgp3CGxOrxQSafdHeuR9RhHoK9ztmA+sez+k6ama EBxA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PualsjDZ8Hl/ydsk8/jFn/XN74rzM8ahBY0wWm5nZPELJV9xyRcD uQUUJj5xGme0fduIh2UFgjE= X-Google-Smtp-Source: APiQypLFb4DMmemLRCfXrT525pYaZiZLrkhQ9H/Ex96NwNTRqTqq7KRoc5tMdeh9cL5dHRhPNl789A== X-Received: by 2002:a1c:2e07:: with SMTP id u7mr6535102wmu.74.1587068188187; Thu, 16 Apr 2020 13:16:28 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:f5cc:: with SMTP id k12ls10461558wrp.6.gmail; Thu, 16 Apr 2020 13:16:27 -0700 (PDT) X-Received: by 2002:adf:e450:: with SMTP id t16mr33563434wrm.301.1587068187150; Thu, 16 Apr 2020 13:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587068187; cv=none; d=google.com; s=arc-20160816; b=imHoSWDlflZyFYyCUCZV0rTidg+t2WDwgy7uLdOg2F7QwIK/wUAC+CaPqJihQzq5wj CPhEIv2427s26W+zlZrIIianQTYOFRbKVceQDu/2VwvwNe9syd+NDFKupcJGEv/vOkii VG6BatH0aBJJmuCWhlfexTAP09tOVKQSYeCxnvbgmP2BVvYs4CJwDWb8XRaL3LcS7sUH ZOPGRMtkJr2rYg+eRFidxFD01/FhJC8tKBeRX/tJlno1VqExdbNLMcBvFumqzf57cx5E me+A5BdISMrQ22pORT5FJrnJ7rUBbn50XWP79CyCiQeRlrqp6eV2fbvivqLiCnzCLicS Xz+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=ZjRz4uqLuyQTNEnQpFHWTMXCzT4Mm/3Xbl6VO7UP74Q=; b=FGlNI4QMTwRkwJNTz5cLa4khz+ow6nRJy1E3ktLs/HddEXuIIMZAqiGmuN4CQDxjL3 n1BKsRVvxhzz61SV/KuqCLdt/brd5n1IHD7AamG1TrTn77y0Dtv/ETGqZ8aHGif+m5xU /1QBTWQDVQcdAq75v/oAUsvUMUuCsnHwEnyWA3+i6//T9rLaPVLZbvhAJMZFq6wL7mQ7 M6dTFhnqTBvTZPLxg7f9gWl8NzEJl9K1eGiyWYcU8VfxUOvV29xADUMGH0DcpzJMooNQ FDU8tYSNqB+145AQnrhdi/jR68JFS9JvsthssfvBsxB2d+zspEzWtIp3mYihuycUaazr NBGw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id z84si187619wmc.2.2020.04.16.13.16.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2020 13:16:27 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4939V26dySz1qsbG; Thu, 16 Apr 2020 22:16:26 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4939V26P1lz1qqkw; Thu, 16 Apr 2020 22:16:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id sdS5QY1ChhJM; Thu, 16 Apr 2020 22:16:26 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Thu, 16 Apr 2020 22:16:26 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id CFAD54540965; Thu, 16 Apr 2020 22:16:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qkXb6WdBn4Rk; Thu, 16 Apr 2020 22:16:23 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id 6880A4540578; Thu, 16 Apr 2020 22:16:23 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] ssbl_handler: Fix coverity #292149 Date: Thu, 16 Apr 2020 22:16:18 +0200 Message-Id: <20200416201622.32387-1-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic --- handlers/ssbl_handler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handlers/ssbl_handler.c b/handlers/ssbl_handler.c index a9c9556..478319f 100644 --- a/handlers/ssbl_handler.c +++ b/handlers/ssbl_handler.c @@ -260,6 +260,7 @@ static int ssbl_swap(struct img_type *img, void *data) if (ret != sizeof(struct ssbl_admin_sector)) { ERROR( "Cannot write SSBL admin : %s: %s", mtd_device, strerror(errno)); + close(fd); return -EIO; } @@ -273,6 +274,7 @@ static int ssbl_swap(struct img_type *img, void *data) if (ret != sizeof(uint32_t)) { ERROR( "Cannot write SSBL admin : %s: %s", mtd_device, strerror(errno)); + close(fd); return -EIO; }