From patchwork Mon May 15 13:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 9726897 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 6F1926028A for ; Mon, 15 May 2017 13:03:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 606F52897C for ; Mon, 15 May 2017 13:03:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53A9C28984; Mon, 15 May 2017 13:03:10 +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 4A5EF2897C for ; Mon, 15 May 2017 13:03:09 +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=qQr g83FAgiT6P5l9INhzJrJqasKrU7LkWdTSHUBF+4TLEwhn5k9m2CMGx0mFcs+oXZFl8kxL4C/Deh/c yrrV7dwhVz7XvAZa+/Bz4mtzdC/Ppuax8HkT5jA0kYLPMqlUZXX+JlNMoJR9hJinx3s77IvS9g319 BlExW5M737tHVp8O7keFNw62uOzOr+7aYaIl7BM4bNZiwR833vLJFRRHMrl3jlCjm/17qPkyYlrkY Gv4zQscAG9VM1Q6vb4MN9riZald2ZxnwNkLQRMitRoThE51zNGbBGkmOTN3ZQhEIQeW+Kwp8boMiF 7rBaWOenhXDEkDHFAfE5xny+t6u3nXA==; 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 1dAFeW-0004Ms-Eh; Mon, 15 May 2017 13:03:08 +0000 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dAFeN-0004KH-7W for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2017 13:03:07 +0000 Received: by mail-qt0-x232.google.com with SMTP id c13so31669260qtc.1 for ; Mon, 15 May 2017 06:02:37 -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=HDF08VZJSrkP1HmIc8BAJa/5nGnhelUa6xbf6foQ5XEDhs1KcQAjjWmLg0Y01LsjPR eyW0wUwYxtFcSnmFUnS6w2lQmAaP9PdZQeVf+hOSinN7XTxrdfnx7dBrlMv/Sqm7ojGU ulfMVv+aHe3NUCcyC8K2kHTLbgjXvfGZ10zbs= 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=SpYuLkE23osadwB8PwycuVRfa7l/TuQV8GTCX4YIH46j2qjDnBiSfWtOy7rDrZnMlD IDw0qDNWkP4qNMKi0lflnPpS7qjNPIY1ccEn7uKcO/3YNLuew1yjvEd1j8lsz7isZ945 XG1+UUJyURLZlN8yxlvdf/eeWd2Xag1BzZtDpi0vB69BQrFoA2gUEV/94/mvLzC09Vfe V6T6UrzCsPNLKKu+ZFlG18dj4tpKghMwFlgbtQEGO+z0e77sHdKQbCNah0f63JUtCgUL QZAxXz0mLbl9r9V27GG1ig68ZlawkbyCp5nPSGBrzwjDa+aJWQKsm3rzinp+xiC82r3u 76UQ== X-Gm-Message-State: AODbwcCdnnaXZLsJ1ubWEOyNyy9W8MRlILJYZncwcgPo5YwKxq0OIInS i0YDCdGi0EqhB4Mx X-Received: by 10.46.82.151 with SMTP id n23mr1973313lje.2.1494853355437; Mon, 15 May 2017 06:02:35 -0700 (PDT) Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id h76sm1866026lji.10.2017.05.15.06.02.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 06:02:34 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] tee: optee: fix uninitialized symbol 'parg' Date: Mon, 15 May 2017 15:01:10 +0200 Message-Id: <1494853270-22019-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-20170515_060301_006017_3A2080CC X-CRM114-Status: GOOD ( 10.20 ) 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,