From patchwork Thu Feb 26 22:48:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45206 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 782BB2043C for ; Thu, 26 Feb 2015 22:48:41 +0000 (UTC) Received: by lbdu10 with SMTP id u10sf11020225lbd.3 for ; Thu, 26 Feb 2015 14:48:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=HM4x6RmT0W8NZpniWD8qdkXTEBhUAlj6ntZJo0H/23U=; b=H3G6gUJvq7O1uWKe+MzfISHi0w9zGU4AKbGQsCAC/rko0BcwNfamcXA7skpC5IXFvO b1Kf5+pxBN1RUnLCpZUOYb3FMoDpIiXyu3VrZLzkBe3HyP2XBp8FProvFh5xVQ3OApxy GLz8J61Yx9swY7mVt2xqks50I60x7CAZNRhJ2LaogcIXRgFI+VBzCTvNZzYsLxH+nhbm 7ul5ZHQDcZSRzD2jMSshM5qq1n1lunV+dKQLfI2KxO97L3g5jmdkNj8rZ58NXyfa7fwH hbJ6LHVjyXgyOM/BGZD+3H7rpJwEQvkn4QFrxPBvFEIJwsUunywB1YQIhVFb0VhBH66/ HpvA== X-Gm-Message-State: ALoCoQnsbf0/4v5pkKZzJ1A8Smv8rnkHICZ29FnzCp0CvWfhRyW5MRf9IdmP1elpFa680Ft1T5/Q X-Received: by 10.112.77.101 with SMTP id r5mr1657229lbw.4.1424990920395; Thu, 26 Feb 2015 14:48:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.65 with SMTP id la1ls88770lab.77.gmail; Thu, 26 Feb 2015 14:48:40 -0800 (PST) X-Received: by 10.112.24.235 with SMTP id x11mr9827563lbf.18.1424990920221; Thu, 26 Feb 2015 14:48:40 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id x1si1609434lax.123.2015.02.26.14.48.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 14:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labgd6 with SMTP id gd6so14094738lab.7 for ; Thu, 26 Feb 2015 14:48:40 -0800 (PST) X-Received: by 10.112.42.225 with SMTP id r1mr9721913lbl.72.1424990920045; Thu, 26 Feb 2015 14:48:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3575281lbj; Thu, 26 Feb 2015 14:48:39 -0800 (PST) X-Received: by 10.229.26.69 with SMTP id d5mr10704575qcc.9.1424990917647; Thu, 26 Feb 2015 14:48:37 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id f131si2189112qhe.125.2015.02.26.14.48.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 14:48:37 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR7EP-0007ph-DY; Thu, 26 Feb 2015 22:48:33 +0000 Received: from mail-la0-f54.google.com ([209.85.215.54]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR7EJ-0007pQ-3O for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 22:48:27 +0000 Received: by lams18 with SMTP id s18so14049673lam.13 for ; Thu, 26 Feb 2015 14:48:21 -0800 (PST) X-Received: by 10.152.19.9 with SMTP id a9mr9995240lae.80.1424990901322; Thu, 26 Feb 2015 14:48:21 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id x8sm466053lal.43.2015.02.26.14.48.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 14:48:20 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 27 Feb 2015 00:48:16 +0200 Message-Id: <1424990896-27170-1-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: crypto patch Subject: [lng-odp] [PATCH] linux-generic: crypto: check 'result' pointer X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Check 'result' pointer before dereferencing it in case of synchronous operation. Signed-off-by: Taras Kondratiuk --- platform/linux-generic/odp_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 2f13e2f..f7e6e02 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -435,6 +435,8 @@ odp_crypto_operation(odp_crypto_op_params_t *params, *posted = 1; } else { /* Synchronous, simply return results */ + if (!result) + return -1; *result = local_result; /* Indicate to caller operation was sync */