Use sg_init_table() and sg_mark_end() as needed.
Signed-off-by: David S. Miller <davem@davemloft.net>
bp->pad = 0;
bp->protocol = protocol;
bp->len = htons(tcplen);
+
+ sg_init_table(sg, 4);
+
sg_set_buf(&sg[block++], bp, sizeof(*bp));
nbytes += sizeof(*bp);
sg_set_buf(&sg[block++], key->key, key->keylen);
nbytes += key->keylen;
+ sg_mark_end(sg, block);
+
/* Now store the Hash into the packet */
err = crypto_hash_init(desc);
if (err)
bp->len = htonl(tcplen);
bp->protocol = htonl(protocol);
+ sg_init_table(sg, 4);
+
sg_set_buf(&sg[block++], bp, sizeof(*bp));
nbytes += sizeof(*bp);
sg_set_buf(&sg[block++], key->key, key->keylen);
nbytes += key->keylen;
+ sg_mark_end(sg, block);
+
/* Now store the hash into the packet */
err = crypto_hash_init(desc);
if (err) {