]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - crypto/af_alg.c
Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[mirror_ubuntu-jammy-kernel.git] / crypto / af_alg.c
index 89ed613c017eaef1f02da30e767ed976608fabc4..49fa8582138b2df45e087f3a31a80ac5d5bbdc2a 100644 (file)
@@ -500,8 +500,8 @@ int af_alg_alloc_tsgl(struct sock *sk)
                sg = sgl->sg;
 
        if (!sg || sgl->cur >= MAX_SGL_ENTS) {
-               sgl = sock_kmalloc(sk, sizeof(*sgl) +
-                                      sizeof(sgl->sg[0]) * (MAX_SGL_ENTS + 1),
+               sgl = sock_kmalloc(sk,
+                                  struct_size(sgl, sg, (MAX_SGL_ENTS + 1)),
                                   GFP_KERNEL);
                if (!sgl)
                        return -ENOMEM;