linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: chelsio: remove redundant premature assignment to iv
@ 2020-05-27 11:29 Colin King
  2020-05-27 13:39 ` Ayush Sawal
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-05-27 11:29 UTC (permalink / raw)
  To: Ayush Sawal, Vinay Kumar Yadav, Rohit Maheshwari, Herbert Xu,
	David S . Miller, linux-crypto
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable iv is being assigned twice with the same value, the first
assignment is redundant and can be removed and instead keep the
latter assignment of iv as it is closer to the point it is being
used.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/crypto/chelsio/chcr_ipsec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/chelsio/chcr_ipsec.c b/drivers/crypto/chelsio/chcr_ipsec.c
index af961dcd317b..f9ad8c93e5ff 100644
--- a/drivers/crypto/chelsio/chcr_ipsec.c
+++ b/drivers/crypto/chelsio/chcr_ipsec.c
@@ -398,7 +398,6 @@ inline void *copy_esn_pktxt(struct sk_buff *skb,
 	memset(pos, 0, len);
 	aadiv = (struct chcr_ipsec_aadiv *)pos;
 	esphdr = (struct ip_esp_hdr *)skb_transport_header(skb);
-	iv = skb_transport_header(skb) + sizeof(struct ip_esp_hdr);
 	xo = xfrm_offload(skb);
 
 	aadiv->spi = (esphdr->spi);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: chelsio: remove redundant premature assignment to iv
  2020-05-27 11:29 [PATCH] crypto: chelsio: remove redundant premature assignment to iv Colin King
@ 2020-05-27 13:39 ` Ayush Sawal
  0 siblings, 0 replies; 2+ messages in thread
From: Ayush Sawal @ 2020-05-27 13:39 UTC (permalink / raw)
  To: Colin King, Vinay Kumar Yadav, Rohit Maheshwari, Herbert Xu,
	David S . Miller, linux-crypto
  Cc: ayush.sawal, kernel-janitors, linux-kernel

Hi Colin,

On 5/27/2020 4:59 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable iv is being assigned twice with the same value, the first
> assignment is redundant and can be removed and instead keep the
> latter assignment of iv as it is closer to the point it is being
> used.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/crypto/chelsio/chcr_ipsec.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/chelsio/chcr_ipsec.c b/drivers/crypto/chelsio/chcr_ipsec.c
> index af961dcd317b..f9ad8c93e5ff 100644
> --- a/drivers/crypto/chelsio/chcr_ipsec.c
> +++ b/drivers/crypto/chelsio/chcr_ipsec.c
> @@ -398,7 +398,6 @@ inline void *copy_esn_pktxt(struct sk_buff *skb,
>   	memset(pos, 0, len);
>   	aadiv = (struct chcr_ipsec_aadiv *)pos;
>   	esphdr = (struct ip_esp_hdr *)skb_transport_header(skb);
> -	iv = skb_transport_header(skb) + sizeof(struct ip_esp_hdr);
>   	xo = xfrm_offload(skb);
>   
>   	aadiv->spi = (esphdr->spi);

Patch looks good, thank you for correcting.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 11:29 [PATCH] crypto: chelsio: remove redundant premature assignment to iv Colin King
2020-05-27 13:39 ` Ayush Sawal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).