diff mbox

[PATCHv2,1/2] linux-generic: handle copy error in odp_crypto_operation

Message ID 1425037871-28253-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 87c4c1c97137f99a8a86af4a947615cd4d1ad526
Headers show

Commit Message

Maxim Uvarov Feb. 27, 2015, 11:51 a.m. UTC
In that case _odp_packet_copy_to_packet can not return non 0.
Because of code is on performance path just cast it to void
to fix Coverity warning.

https://bugs.linaro.org/show_bug.cgi?id=1054
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 <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Bill Fischofer Feb. 27, 2015, 1:34 p.m. UTC | #1
On Fri, Feb 27, 2015 at 5:51 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> In that case _odp_packet_copy_to_packet can not return non 0.
> Because of code is on performance path just cast it to void
> to fix Coverity warning.
>
> https://bugs.linaro.org/show_bug.cgi?id=1054
> 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 <maxim.uvarov@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/odp_crypto.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/platform/linux-generic/odp_crypto.c
> b/platform/linux-generic/odp_crypto.c
> index 3d59108..4998b8a 100644
> --- a/platform/linux-generic/odp_crypto.c
> +++ b/platform/linux-generic/odp_crypto.c
> @@ -388,8 +388,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))
>                         ODP_ABORT();
> -               _odp_packet_copy_to_packet(params->pkt, 0,
> params->out_pkt, 0,
> -                                          odp_packet_len(params->pkt));
> +               (void)_odp_packet_copy_to_packet(params->pkt,
> +                                                0,
> +                                                params->out_pkt,
> +                                                0,
> +
> odp_packet_len(params->pkt));
>                 _odp_packet_copy_md_to_packet(params->pkt,
> params->out_pkt);
>                 odp_packet_free(params->pkt);
>                 params->pkt = ODP_PACKET_INVALID;
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 3d59108..4998b8a 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -388,8 +388,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))
 			ODP_ABORT();
-		_odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0,
-					   odp_packet_len(params->pkt));
+		(void)_odp_packet_copy_to_packet(params->pkt,
+						 0,
+						 params->out_pkt,
+						 0,
+						 odp_packet_len(params->pkt));
 		_odp_packet_copy_md_to_packet(params->pkt, params->out_pkt);
 		odp_packet_free(params->pkt);
 		params->pkt = ODP_PACKET_INVALID;