From patchwork Tue Dec 23 11:39:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42565 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5B5C2188F for ; Tue, 23 Dec 2014 11:40:55 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf3945703lab.11 for ; Tue, 23 Dec 2014 03:40:54 -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:in-reply-to :references: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=v1k2mq0lvhx1OsRjjoY+lG0kwvLL66WNsFDMaAZQqpw=; b=XFdbPzV7qieOuqysAAylSuuGXIZI1yjvubPQdyGYQJ9anRct8ykJJn+O/cENR+cz3K 1YHaNPFQmpd3QhMWdm2l4MX5CylfVp7mCGNz72RVWrgHbuOWeKnr5qqYf4rw9krumfew 6UZ6nW8hT2j8r8zOutuTAyoNa/J4Sj9v/FW61m9Ia24MdEobejECeqIWV1KsTd9RtRbe /qiY1fLmyEBQxxUDV72f/Se3JatcQd9kfYh9A2yw56crSdlBufOInZwxLBmlEK54xqml LZ/iYaYoaAuju+3WhgDJc6XzgZ4h/fN5vnymWLazx2Vsqycwc+K0VFsg5fByBnLmKAql PP3A== X-Gm-Message-State: ALoCoQlY21J10Je6Nf7EUrOOZoJl71YIh/fSv/Q+LPHKYEOOUmPbGGLbNzz097ob+J+ktnU4J4bY X-Received: by 10.152.6.202 with SMTP id d10mr10351laa.10.1419334854625; Tue, 23 Dec 2014 03:40:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.200 with SMTP id d8ls1174063lah.18.gmail; Tue, 23 Dec 2014 03:40:54 -0800 (PST) X-Received: by 10.112.150.136 with SMTP id ui8mr27261956lbb.60.1419334854478; Tue, 23 Dec 2014 03:40:54 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id yj3si10003958lbb.26.2014.12.23.03.40.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:40:54 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so5325121lab.4 for ; Tue, 23 Dec 2014 03:40:54 -0800 (PST) X-Received: by 10.112.135.6 with SMTP id po6mr27003646lbb.69.1419334854382; Tue, 23 Dec 2014 03:40:54 -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.142.69 with SMTP id ru5csp1300465lbb; Tue, 23 Dec 2014 03:40:53 -0800 (PST) X-Received: by 10.224.96.129 with SMTP id h1mr44361180qan.46.1419334853151; Tue, 23 Dec 2014 03:40:53 -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 p7si2496528qah.42.2014.12.23.03.40.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:40:53 -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 1Y3Npa-00024T-8m; Tue, 23 Dec 2014 11:40:50 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y3NpH-0001yG-Tz for lng-odp@lists.linaro.org; Tue, 23 Dec 2014 11:40:32 +0000 Received: by mail-lb0-f174.google.com with SMTP id 10so5142545lbg.5 for ; Tue, 23 Dec 2014 03:40:26 -0800 (PST) X-Received: by 10.152.4.200 with SMTP id m8mr16409417lam.17.1419334826253; Tue, 23 Dec 2014 03:40:26 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id cy6sm5784098lbb.39.2014.12.23.03.40.24 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:40:25 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 23 Dec 2014 14:39:58 +0300 Message-Id: <1419334799-19653-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1419334799-19653-1-git-send-email-maxim.uvarov@linaro.org> References: <1419334799-19653-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCH 3/4] linux-generic: crypto check return value for odp_packet_copy_to_packet 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: maxim.uvarov@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.45 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 CID 85004: Unchecked return value (CHECKED_RETURN) Calling "_odp_packet_copy_to_packet" without checking return value (as is done elsewhere 5 out of 6 times). Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_crypto.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 13c5556..09adda1 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -350,6 +350,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params, enum crypto_alg_err rc_auth = ODP_CRYPTO_ALG_ERR_NONE; odp_crypto_generic_session_t *session; odp_crypto_generic_op_result_t *result; + int ret; *posted = 0; session = (odp_crypto_generic_session_t *)(intptr_t)params->session; @@ -362,8 +363,11 @@ odp_crypto_operation(odp_crypto_op_params_t *params, if (params->pkt != params->out_pkt) { if (odp_unlikely(ODP_PACKET_INVALID == params->out_pkt)) abort(); - _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0, - odp_packet_len(params->pkt)); + ret = _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0, + odp_packet_len(params->pkt)); + if (0 != ret) + abort(); + if (completion_event == odp_packet_to_buffer(params->pkt)) completion_event = odp_packet_to_buffer(params->out_pkt);