From patchwork Fri Jan 18 19:19:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 156043 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3612084jaa; Fri, 18 Jan 2019 11:19:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+DGpPN4dvyJc9/VyT/dr8JXNt5UJj/lyWK1uwAvjDplAoews7q5AshVdrzPRS6b2Mxdvg X-Received: by 2002:a17:906:dda:: with SMTP id p26-v6mr15781628eji.6.1547839154467; Fri, 18 Jan 2019 11:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547839154; cv=none; d=google.com; s=arc-20160816; b=qjOBrh72neDAMbQ2hUUivq/FHA4H/KuJB6qTSwG3Q5gEDBbEUV6XW1yGDbxZzg6XjN +n+L3YrVUvDJfuvA9xZq6wGFTHC8sZiul/Ap9s9AJD4mgiiD4FC9JsXlJNDsr4YMzjJX rogTFagTzeZEhUeVqykGPZ4MFtc47gkA92ssMrKh/hAakFGLTT3gafSBsA6FqLNB4BkH 1opIviILyyi9pb+EoZxOyUZquIh8lrr62KckWfXT1b8hv+y4x3SiNJl13tm5UnH7RMWl cEN7tqrXAvup49Rvpvfc21Z5o+YuoJpl3hlsvcd6I3NT5O6PDfl/KFpmGwghlQ6MytqM LsoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=rVfAsZXxxPDGgu+Gy1PvIQwtvlfGTwQ/oQkMyZ3OYCI=; b=NBvAFYDZOaLemzeUVFk0s4YWWDovoVWGgJ0z9zz0iLZ9b5fxiN3n7eUflZXzI8aQt/ pR52SLCE0DEE/LoJCRK8X2hQpldS+qpAT1rJ7EOX5/9tA+UU2TPFLpg703JgXjkrQbcN SEjIG/99tCISPg9/vogL3Z6wKhTwR6PEpeeA3XaHmOxjlmFnQ1Bbgo7xc2DrTRcZ8aa3 eLEwKsRTM/FxMuM0yZSy8PCCL6q9/XI1i8PXHpVX0MdlARh6eD1QYwQ6i96M5oYB/Gak WSQcRC8oAexCsOquHJEuQD6gU/qnuGBtSw4HY0Ffg28UiZ9lQNtN9fGRodUqRwnejr2Y ZAuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Fu2dGQVd; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id w26si3813425edt.407.2019.01.18.11.19.13; Fri, 18 Jan 2019 11:19:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Fu2dGQVd; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 3F5BCC22153; Fri, 18 Jan 2019 19:19:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D6697C21C6A; Fri, 18 Jan 2019 19:19:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E9F72C21DED; Fri, 18 Jan 2019 19:19:07 +0000 (UTC) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by lists.denx.de (Postfix) with ESMTPS id B218CC21C6A for ; Fri, 18 Jan 2019 19:19:06 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id b20so11257079lfa.12 for ; Fri, 18 Jan 2019 11:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qbH7+jDj0T5bpRP3sg3tZZrvwcc2gT46dmRk4hhj/K8=; b=Fu2dGQVdp1gkZE3va0yqxwcJmsJUcXgWi3avfhSkUqB3x0IuuESWiCTgcEiOITZ0G9 8YOc3zoWrvsUXl58MxVrY9wku4nGgFGgFmdyxkiqe1ZT2AAMxqka9UINbBkN0uoe+8R5 stsVfdNvuzMScmcJ3qAxSva1OynV8psuHzPJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qbH7+jDj0T5bpRP3sg3tZZrvwcc2gT46dmRk4hhj/K8=; b=G0uFuG0yQ0JG/YxqSqvNDQ4GkDWldWucjNXxlaBsdSWGJMUsIUBz0zFZR9CdQOce5P Td/f8zMr6684T+Dk89XLS4AQqlo58SjXL0rsZj4KvksKxxjRvDKtdH+hJAcC8omxLJi7 12PmSbFFA67HpHB9hNT7v7r74BMXys4QKwFL4cFZlds1cJ8lg5FsLnJBg9K8ytG7TDk5 AILv6vd3+BqpJyjJEAuphLtLHFc+WI/5/IQWxQBYHLNw1IcqAbYW+MNmJvIxsxz2Bzue 9TxRSP8keoPwc/7X31uVNgQYVa1b7luX/kHlYGA4e090KCqWbS2SzdabYDBKhTT3KsYC 3BMA== X-Gm-Message-State: AJcUukdHqoJFRGLhEd0bsVS1REoxPs817zR/EF7IU/C83I64Qg32ZMEI bodxwQL+nCNx03bQGH9Bh5RoA7Gc2mw= X-Received: by 2002:a19:8c1b:: with SMTP id o27mr13287843lfd.90.1547839145833; Fri, 18 Jan 2019 11:19:05 -0800 (PST) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id r203sm926136lff.13.2019.01.18.11.19.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 11:19:05 -0800 (PST) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 18 Jan 2019 21:19:02 +0200 Message-Id: <20190118191904.634-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Tom Rini , Nicholas Faustini , Maxime Ripard Subject: [U-Boot] [PATCH 0/2] env: Fix "env save" to malformed environment X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case when environment is malformed (e.g. zeroed out), we are not able to save new environment to that location. Let's fix that by not considering the location with "bad CRC" environment as not accessible. Sam Protsenko (2): env: common: Return specific error code on bad CRC env: Fix saving environment to "bad CRC" location env/common.c | 4 ++-- env/env.c | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-)