Skip to content

Commit

Permalink
ipsec: Remove unneeded extra variable in esp4 esp_ssg_unref()
Browse files Browse the repository at this point in the history
It's assigned twice, but only used to calculate the size of the
structure it points to.  Just remove it and take a sizeof the
actual structure.

Signed-off-by: Corey Minyard <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Steffen Klassert <[email protected]>
  • Loading branch information
cminyard authored and klassert committed Jul 20, 2021
1 parent c18e940 commit f8fdade
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,

static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
{
struct esp_output_extra *extra = esp_tmp_extra(tmp);
struct crypto_aead *aead = x->data;
int extralen = 0;
u8 *iv;
struct aead_request *req;
struct scatterlist *sg;

if (x->props.flags & XFRM_STATE_ESN)
extralen += sizeof(*extra);
extralen += sizeof(struct esp_output_extra);

extra = esp_tmp_extra(tmp);
iv = esp_tmp_iv(aead, tmp, extralen);
req = esp_tmp_req(aead, iv);

Expand Down

0 comments on commit f8fdade

Please sign in to comment.