From patchwork Mon Sep 3 14:46:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 145801 Delivered-To: patches@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2575444ljw; Mon, 3 Sep 2018 07:47:25 -0700 (PDT) X-Received: by 2002:a2e:4557:: with SMTP id s84-v6mr17440881lja.47.1535986045281; Mon, 03 Sep 2018 07:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535986045; cv=none; d=google.com; s=arc-20160816; b=xFOJ5+Z1gGath+1VdSsrtMY6ditUgnN/75eF+7d96hKSM5ebpI7qQhbKuo9Z/xeDxN lG7UTdbnKVkB5c/3WVaejR4wHK72d5va3gejDxc/BITVG5R/+tIl6K8TpjDpQPogLjnx LvdTy6+TXaYkDuPNsT1+6/+Ln7aGelhoEuTopglx3uDGoE9LOSDC1/MwReDHPzOK4t8R 8eoqrlKAOkYywj+675w7U1SKXwfodgYkPdAfcOUL3k1u8gk6ssrIJpy8nFX8TKge7g4H CEMPESMnE8okKgnlUreazaXhY2KU4QsCdMenNfTECVd/xR4L9Jvg//Pr5kXm2u4kkCnf 1amw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=MvAIS+ckxlGzE9N89gxX0Q94LGWzUIHA2MGYL9i3jeA=; b=YGa6a7JUF2cE1KhB3pYGM5RbBkU3BkxmS3Y4IMxwEUL76MDHQybLjNXkDqZybQuiLP oQlN1Pa58rDFaWf3QtGkfGU3v5mYSfg1YIf51DlNL5s1qvjKOdb233404pU+h7iZkT0d 41M50SYx4tWmZBWRqHZxwYOojRlHA3orn8c4fW2s8Bn0cHa/M3YY/td9wb6FW/jSnpd2 HPUS3zjXoVNlmwfdWlT0VwtIc5DdceM9mh770Z6z8vBzWxsmhtcz6nMSGYKVawJIcgYd GPnFHkMOBkORl3JuTLnKk16m6DRKC3q1Q7tSQRAknV9xbajxgQ+WnZjhUsaDq6y6BEQA vLEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Je9z2NVv; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f17-v6sor5460854lfi.43.2018.09.03.07.47.25 for (Google Transport Security); Mon, 03 Sep 2018 07:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Je9z2NVv; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MvAIS+ckxlGzE9N89gxX0Q94LGWzUIHA2MGYL9i3jeA=; b=Je9z2NVvDh2mt84SXikl5j5E2SrdqMeMmeAQ662lxwe8sRcRmT7+lKr4CKWVSa59CG 4/BeK6Z1LvrDJRJNAmJqtabIJDfyRwPFGpt8FdgYNkLc1hEIb1iEfCQtsSbNeMv7C0kx 61idAR66GsCchUyJOS8EPAxnjjE/dBp8oIbpg= 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:in-reply-to :references; bh=MvAIS+ckxlGzE9N89gxX0Q94LGWzUIHA2MGYL9i3jeA=; b=KDlF6bn61KGvya3eS8B08QucmaRkMZTEStpn0HVCjfNrv10fbWN6YGkr3jYbso7W7a sJ/gtBaDjHaRG884+bLey0pbB41h7TNWRTgkPBKm/VfVU4nSKFS4AAAhfRuQkGXZDMyz 0foIpuVTvUiNhnYQmzScLCLtXBwMZa8ZlgqReIyIF2HosYCBBRyVBKm46Wo2e1TKNzH9 nloCxuZpjONeymr/1qye1we1Thx/PvOE3+Ebpl1OQMiHgrBBGtlHY9qg5bRUy4PaHPf0 UC7yOf8+Uy9ReLbJ7mllAOBuMJb/ko7/8wSDaQ3J7XPLFpVVjNEzO+P2VzbQHXr8lcxh ZdHw== X-Gm-Message-State: APzg51DIJlDh8PCGnh/eNybx5ZPw9u+kyr5dQETNsUQpBWuquaMkwrXV qyUUD/tTw5wQqKbBMZ92TbKu1khm X-Google-Smtp-Source: ANB0VdZeKKjZ6ijDugXlUy5DQPBoFVo54hkDYmg1BSF+UOiZIkfCanPgT8Fd8YaX5juHpu+Y/i0z2g== X-Received: by 2002:a19:a549:: with SMTP id o70-v6mr14942043lfe.147.1535986044457; Mon, 03 Sep 2018 07:47:24 -0700 (PDT) Return-Path: Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id w18-v6sm3343431ljd.73.2018.09.03.07.47.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 07:47:23 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Tom Rini , Jaehoon Chung , Pierre Aubert , Albert Aribaud , Peter Griffin , Michal Simek , Jens Wiklander Subject: [PATCH v3 04/20] avb_verify: bugfix avb_ops_free() skipping free Date: Mon, 3 Sep 2018 16:46:55 +0200 Message-Id: <20180903144711.31585-5-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903144711.31585-1-jens.wiklander@linaro.org> References: <20180903144711.31585-1-jens.wiklander@linaro.org> Before this patch avb_ops_free() was returning early if supplied "ops" argument was not NULL. This patch fixes this by inverting the condition. Signed-off-by: Jens Wiklander --- common/avb_verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Simon Glass diff --git a/common/avb_verify.c b/common/avb_verify.c index 20e35ade3029..3a1282a09204 100644 --- a/common/avb_verify.c +++ b/common/avb_verify.c @@ -732,7 +732,7 @@ void avb_ops_free(AvbOps *ops) { struct AvbOpsData *ops_data; - if (ops) + if (!ops) return; ops_data = ops->user_data;