From patchwork Sun Jun 28 15:13:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1318599 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::33e; helo=mail-wm1-x33e.google.com; envelope-from=swupdate+bncbcxploxj6ikrbjxh4l3qkgqexamteti@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=mdT3zrvQ; dkim-atps=neutral Received: from mail-wm1-x33e.google.com (mail-wm1-x33e.google.com [IPv6:2a00:1450:4864:20::33e]) (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 49vvK52tT7z9sPF for ; Mon, 29 Jun 2020 01:13:44 +1000 (AEST) Received: by mail-wm1-x33e.google.com with SMTP id v24sf17052319wmh.3 for ; Sun, 28 Jun 2020 08:13:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593357222; cv=pass; d=google.com; s=arc-20160816; b=jFiVyFZPXkeDlDJ1MT2Upneual8q40ciIWm8dFf3fUd9dEUcu470x/hE/F8+ZtL8a/ 0U0lM1rSyqPGdCqwwjoRQlVSZGT29TZNGPHBfE3bzhYOWX6rQCO4arII9J6vJ/T470qG 9QdV5cUi10m1ouUCvc9ip52ivypqk6WhhPKes5Hhz9Zoh7A/RxkTwAUttZ9ohBXaYx9I sxZ4pz2S17LJWh8hSrBHsbrkiRCBtB4ITidqOnvLxVXD1ZzxxQWGYjtxdGD6EhPXU6OT 11zEdXihqwtQ6gdmbBXe9GGj3zeiqGhOAkzCqet6FJZwm7qmTghEFKbzecCI5awEx6jb 6gYA== 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; bh=J16/DSSJrfEoKw19kPRBadNnO3pIdiM9dsJXAsvtk58=; b=jzDz7jS1uNzOq3wildeUh6w3GhNFL+EZgI0X59q0votuhg9c8J24qEDmM0iowbehK4 mt0BjGjw25v7qH/FrR9NGV0sJg4JpkLUvDVieCt0AhtmFpT8+fLPARb4CNtXnBat8jlK PFdNLs3fKcpmlCLyBvSwBiPPFI+iBHHf3bUw07K8ac7BqoAutzlWV6RZvMH0yPMRh9ma s5RA1vf39W0OJu9gf7B257IvK1dtDWUUbYSs1P82YddV6HG5B8b3CeuM60UBD7GhsDYn sTYOXH+wgIeMFLUrERU1MI1kv0UnsiTN5TJriXHJKFqxwlX55/pQbGhGiCovE+FSJcTE vxbg== 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: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=J16/DSSJrfEoKw19kPRBadNnO3pIdiM9dsJXAsvtk58=; b=mdT3zrvQieHGi0bP0mzeaA1DklvEZ8stP63kft3dMIV0YrpvSn+yKYpJn+e8XUsyNo oug/ofe94s1h6XsfZO2pFyzVY3yl10a9tLWcLbtP3ToLqahFibP8m17Q1m0gD6z7NObq jMDVM9Agb1M8bv3d3b6hchKUExFIRJf+2Qz62FQXQRLa47kSoPOUEnEHo8F2F1Pbg0TO VFGFHeuYNw2jyzPYYG8Uq+TR/xEd/fZg3LUXaOI2QlUv0LFYgeFZ70Ccco82uHCJipsD zLtVwgIIgCFbUUNoMVIHR0rayRDi3SW10cWldeej0nzM41ytuyjxKzg3QT14EfvS34oL Ti5w== 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=J16/DSSJrfEoKw19kPRBadNnO3pIdiM9dsJXAsvtk58=; b=llBwW2dxx7ygfaE96aDMaeDzZKueL4WYe3PpcagX6aUdAGRrPwh91FqStg8l4cwpKX TGwNwlOaUl7kVnYyLFluuvnpb946gt+Essk22SrXqpB8zdpM6nNHQDQ/PXcucjrpwXPo yuRWaJ0S94XZozToxq55KGcXA/JzeftQ8/QTWMOeUFPA0XmlEDe71XYS+/POibqCkeTd vhJsvI/X5G0AO3vf/iO+bZjJjbpVZcy+wLCrFP/z9EVDWh6eVWFMF/QPOevE0ij5qhCk 9F5val3p1rHZhd1h+c9Bk4TcFZKJtUhJ9ljJBHKUQeXoaodsqVxWw7A2xPZLPNOYvMKc kytQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5333cf+Kqal1VgWJrtbyF6WoWKqcdnYc79o6v0baoWOkyG2aH+H1 a6xUMpCjdCNn/w9LReZIAiY= X-Google-Smtp-Source: ABdhPJxFKgpIgn2TYZJyEjyreSadiwLJ9bms8jYZSffnXiuINNDI99eFD709qFmz1tVkLFiuvCZWVg== X-Received: by 2002:a1c:3c82:: with SMTP id j124mr13640659wma.155.1593357222641; Sun, 28 Jun 2020 08:13:42 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:9a81:: with SMTP id c123ls6729494wme.1.canary-gmail; Sun, 28 Jun 2020 08:13:41 -0700 (PDT) X-Received: by 2002:a1c:96ce:: with SMTP id y197mr5226567wmd.86.1593357221946; Sun, 28 Jun 2020 08:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593357221; cv=none; d=google.com; s=arc-20160816; b=tegc+FWzdFLC5riSaekOaZEjRt+M7IaPNhXClARophDMBrKkb1TLVhfTvOz1MnA5Dn /sVDt7bS/27Q6i+dCL6fF04N601YqrLLNA2cPk5Wbg4k5aIVG64VQ20OKLmLv3IaKTW0 IEz1Xw+e8t1zv6hKHLVeh7MMqS1qbgbjfztTDfy3sViQf7mNvkke9bPuJMeUIojLMWmY O7YaIPFca/eHM7NjaqCO6O8k6fBfyMIHFxYubMR2glgOWyCX+MIZo2R3a9Gne2eZoV2n 8UV+7sqsUZw2eacJ3G59SgiOdbMOt8gBRNLqPURrYHzn3/gicbILBnfBfDxLhaN/vTl6 wK3g== 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; bh=o1NKP2vKh6CRmgIY8NX7HxI80/Y+AXT7H+q4TFhpBH0=; b=sQv+WpYgAyKz+5kpMTD8+91GZ/lP25mDxHSY5aWCfZh5HY9m+ixauRwBTDjrAxdx6t b/GIToDBUtyUh88v1/91ZkoTetYJLglqRc/yW6MbpLpdwx9jLicYzeugO5043PNA8ovO rgxVcl6R/OfIWHapu+t9ldY7zqR2/paAH9nn6EcYmBQldbA8+1fBtEiHgxqf/l2Qc9T7 4pvb/l2ZhnNHh6Hn8oobnRnxuUxKlX4HqYn3jjSHweTUxJjO6+ogOvLujleYJIYoyND2 ZpemyPo8JO0mQSVwEzmaSC364JbVf5Swt3oD0LDidwr2bID2gM108bbMVASDMKuQUdCY 0/3w== 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 q12si1224504wrw.4.2020.06.28.08.13.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2020 08:13:41 -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 49vvK14bYWz1qrfr; Sun, 28 Jun 2020 17:13:41 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49vvK14M9lz1qw6c; Sun, 28 Jun 2020 17:13:41 +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 xlRHJfxhg3nV; Sun, 28 Jun 2020 17:13:40 +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; Sun, 28 Jun 2020 17:13:40 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 72E53454069A; Sun, 28 Jun 2020 17:13:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id VU2OingTiIUR; Sun, 28 Jun 2020 17:13:38 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 1991A4540601; Sun, 28 Jun 2020 17:13:38 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [libubootenv 2/6] Fix coverity #293499 Date: Sun, 28 Jun 2020 17:13:32 +0200 Message-Id: <20200628151336.952051-2-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200628151336.952051-1-sbabic@denx.de> References: <20200628151336.952051-1-sbabic@denx.de> 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 --- src/uboot_env.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uboot_env.c b/src/uboot_env.c index 514e722..f92977b 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -605,7 +605,7 @@ static int filewrite(struct uboot_flash_env *dev, void *data) static int mtdwrite(struct uboot_flash_env *dev, void *data) { - int ret; + int ret = 0; struct erase_info_user erase; size_t count; size_t blocksize; @@ -622,7 +622,6 @@ static int mtdwrite(struct uboot_flash_env *dev, void *data) erase.length = dev->sectorsize; sectors = dev->envsectors ? dev->envsectors : 1; buf = data; - ret = 0; while (count > 0) { erase.start = start;