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: 9756397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76036602BF for ; Wed, 31 May 2017 09:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7304628405 for ; Wed, 31 May 2017 09:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67DCD28484; Wed, 31 May 2017 09:26:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EBC9B28405 for ; Wed, 31 May 2017 09:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=a1rsJXjZWq7CGsxr8yZTQUR3umGs+b33SBXd9IwfQ1o=; b=RvU 5h3W9Hbi2dFyunjOm+3+1YtR7cgr9QNJzjCQPVH0HJDM+pNAMU72M7KZ5Paw1MZRkltvnu9V60nYx oCPfL3kokI887Erv8JKFy/J3aD+wr9ue8weB1EYKini9gOoK+fwL4/KsakPnG6oYcbHp30GoHrzlK YF3wMf36DQWxmytNpnm1thJ9Ba4loM7nCcb13PM5b8yXsGpwkl+G0mUv5AYMx2wUadq7V5OP03cTn Cny7IgIkOwYq+64e2b/I2iozH51wMjh2F2jeE5mDlCnKMqaacpvd2nIyaTDPzbwB/7x6vqpF3TETt 23PR7s17kiNiVNDUnpRGOM6h3ZyPkuA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFzth-0006T3-R5; Wed, 31 May 2017 09:26:33 +0000 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFztd-0006Q2-5V for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2017 09:26:31 +0000 Received: by mail-lf0-x236.google.com with SMTP id h4so5587520lfj.3 for ; Wed, 31 May 2017 02:26:08 -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=ehEWpK4tCCXx91eYFPkWAF+K8L+T+zUEOU3lYWwfPwi3QIm5DG/6YVgG1WCWoEKv5r rhdCdCZbbGsEg92rj/ekbNTHoUvhwkHASvlcwO1NJNbK7Oj35hLvrP3Y2KLoQXONm13v ZQmNFxO4Uw3tO0XvI+m7vtXXcqrU7iwt/afVPlBCkywwSSvi8/q+FHjXrtpRTNOcxy1D v+oSFGZ8yaGX4T9V7qEI9lLHRfS3/t1AXJuqqTiJFvIf3BKo04MfnCV8fOhFgJk/pr/K N1Xt+u+cFxv3uQRgnD6l2qS/vGwTZqR45l8gnympjSuiIBFPphaamSj4YIkBJ8Ryu2oD WCcQ== X-Gm-Message-State: AODbwcCzweSHIyo+i/Jse+lx/e1QobbLMYwCs0kRds1SstXuXROzQbvb 1O7W4hT8twaYNEo6 X-Received: by 10.46.74.1 with SMTP id x1mr7930244lja.117.1496222766920; Wed, 31 May 2017 02:26:06 -0700 (PDT) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170531_022629_588793_E14FA5AE X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Carpenter , Arnd Bergmann , Jens Wiklander MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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,