From patchwork Wed May 31 09:25:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 100738 Delivered-To: patches@linaro.org Received: by 10.140.96.100 with SMTP id j91csp234228qge; Wed, 31 May 2017 02:26:07 -0700 (PDT) X-Received: by 10.46.76.18 with SMTP id z18mr8012142lja.9.1496222767332; Wed, 31 May 2017 02:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496222767; cv=none; d=google.com; s=arc-20160816; b=uD2Xrcr7DjdZyxNg1Xs4/xaWBGle+cH+ZVDQrq2AK1tk4H1yoYC1gJA10UF7qh8k96 ynmIbWaiuAqb9cdxu3orqemsQ7v++zy+JQgsLRBR6D7xpQVbujmIC6rutp+gisV4Kef8 qxd7YqN/WPU3oP1E3BZz1UZHxP2yLA0yPGqD9+FgRd3jANCDwOr7DZvORzyp7wEUYk1L rQFP4BGfM4K03qbsF8lHbO17/1Aix3M2TatwGH0+QYf1pRsSj04+77T9o9BTCx2Jz+Mb xaEZni1dTA6YrSIUURzUHxtMffH2ULFIbV4Gte2ddY1mdGIykb44eKNMNqokdNyXMVq7 jROA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=vodONn2mZwYAY3ZgC68hgiGQA5lRHl919eYfsP95iQQ=; b=seIcEimYSnQDqqb3sFmJNtetZ1hC3hRUAdIVhFXhxg0JrNrxrd6Z7ICZdV0R4bro/y hzqcGeGPaQrg8+WOXy3r+vNuNAaDkJu1oNXJkBrK7he121GMfS0mwdHZ78m0khHoPfsh H+V6gEi249DpWJV2ZcoKzYDZq4Oxm44SxwKi/pjKnnOFki3fWItxhUQzLp6JNp/xn6rN chq0Qo/bMUFOJG26dMb8+uFT82+5ShN5L7Htf46t9yEaO2Ycc1UPV0h1QMCfhvRrg3pZ YONjCCf24aubiV3mKy9KYakVCpCC4MFCbJdvleEiCHPVXPDjfFfU9cdpHePVLQIfNinz qjxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 2a00:1450:4010:c07::235 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-lf0-x235.google.com (mail-lf0-x235.google.com. [2a00:1450:4010:c07::235]) by mx.google.com with ESMTPS id l9si9480618lfk.164.2017.05.31.02.26.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 02:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) client-ip=2a00:1450:4010:c07::235; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x235.google.com with SMTP id c184so835488lfe.2 for ; Wed, 31 May 2017 02:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vodONn2mZwYAY3ZgC68hgiGQA5lRHl919eYfsP95iQQ=; b=hK7nYzXc+PP1EmiRBwrnm0MYXfh79gEjd1N0IJx+fRXC2AKMaaInoSDMODNsH7hqGn KrAy9P7fBX6nea8wWtE9Qqc/kU5DGlex42MWykcIMedTWJte/EkQwdMNaDxHIXfugZvy yzWSeD/h77vlVjx+fHSnKu/+MDbQLqQw8Y+ic= 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; bh=vodONn2mZwYAY3ZgC68hgiGQA5lRHl919eYfsP95iQQ=; b=QC/V32L2Eu3tXDwg6pazgYBgEuBEx4Kg+FY1ZpqYlRX8tIJkKVqvu9cKAiUSQCcEmZ 8NmivoZJ1m/Yxvnh3zPig9CiVZw5AhRTFGv2lhQueKCYv6J53Sxmcnm4A7tuSv3qd6mj LGFqYKl4wvZL+/v5iLB6W8GyWoE0PNR0fIYw9Fwo/Yh8qhnD7d0+zZmsfYkY8a8I06Q1 a7A0kpOk5FxYVEwRaMaG6uruEN3/lkbwNGZs/ctg7SV+1xX/8FfPekkr9R+Sw9JVps0F Tfinsg/JgdMn4pq9J5hdamIH950fNs0RBJC/EuHpZJoAyKhOa5ZfCmznxghqWWcai+0I luqw== X-Gm-Message-State: AODbwcCG92cG+Ijxju8Ds2xKSUORoRpBd/LDgWiOFvg0rAJ65Yt+DsW7 a0hlrxgm3hp18RZ09Kg= X-Received: by 10.46.74.1 with SMTP id x1mr7930244lja.117.1496222766920; Wed, 31 May 2017 02:26:06 -0700 (PDT) Return-Path: Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 25sm3489681ljp.2.2017.05.31.02.26.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 02:26:06 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org Cc: Arnd Bergmann , Dan Carpenter , Jens Wiklander Subject: [RESEND PATCH] tee: optee: fix uninitialized symbol 'parg' Date: Wed, 31 May 2017 11:25:40 +0200 Message-Id: <1496222740-11217-1-git-send-email-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.7.4 Fixes the static checker warning in optee_release(). error: uninitialized symbol 'parg'. Reported-by: Dan Carpenter Signed-off-by: Jens Wiklander --- drivers/tee/optee/core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 58169e519422..857141e29e80 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -224,13 +224,14 @@ static void optee_release(struct tee_context *ctx) if (!IS_ERR(shm)) { arg = tee_shm_get_va(shm, 0); /* - * If va2pa fails for some reason, we can't call - * optee_close_session(), only free the memory. Secure OS - * will leak sessions and finally refuse more sessions, but - * we will at least let normal world reclaim its memory. + * If va2pa fails for some reason, we can't call into + * secure world, only free the memory. Secure OS will leak + * sessions and finally refuse more sessions, but we will + * at least let normal world reclaim its memory. */ if (!IS_ERR(arg)) - tee_shm_va2pa(shm, arg, &parg); + if (tee_shm_va2pa(shm, arg, &parg)) + arg = NULL; /* prevent usage of parg below */ } list_for_each_entry_safe(sess, sess_tmp, &ctxdata->sess_list,