Skip to content

Commit f8fdade

Browse files
cminyardklassert
authored andcommitted
ipsec: Remove unneeded extra variable in esp4 esp_ssg_unref()
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]>
1 parent c18e940 commit f8fdade

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/ipv4/esp4.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,15 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,
9797

9898
static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
9999
{
100-
struct esp_output_extra *extra = esp_tmp_extra(tmp);
101100
struct crypto_aead *aead = x->data;
102101
int extralen = 0;
103102
u8 *iv;
104103
struct aead_request *req;
105104
struct scatterlist *sg;
106105

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

110-
extra = esp_tmp_extra(tmp);
111109
iv = esp_tmp_iv(aead, tmp, extralen);
112110
req = esp_tmp_req(aead, iv);
113111

0 commit comments

Comments
 (0)