algif_skcipher.c (408afb8d7847faea115508ba154346e33edfc7d5) algif_skcipher.c (76e43e37a407857596778c9290720ace481879d0)
1/*
2 * algif_skcipher: User-space interface for skcipher algorithms
3 *
4 * This file provides the user-space API for symmetric key ciphers.
5 *
6 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 86 unchanged lines hidden (view full) ---

95
96 /*
97 * Create a per request TX SGL for this request which tracks the
98 * SG entries from the global TX SGL.
99 */
100 areq->tsgl_entries = af_alg_count_tsgl(sk, len, 0);
101 if (!areq->tsgl_entries)
102 areq->tsgl_entries = 1;
1/*
2 * algif_skcipher: User-space interface for skcipher algorithms
3 *
4 * This file provides the user-space API for symmetric key ciphers.
5 *
6 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 86 unchanged lines hidden (view full) ---

95
96 /*
97 * Create a per request TX SGL for this request which tracks the
98 * SG entries from the global TX SGL.
99 */
100 areq->tsgl_entries = af_alg_count_tsgl(sk, len, 0);
101 if (!areq->tsgl_entries)
102 areq->tsgl_entries = 1;
103 areq->tsgl = sock_kmalloc(sk, sizeof(*areq->tsgl) * areq->tsgl_entries,
103 areq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl),
104 areq->tsgl_entries),
104 GFP_KERNEL);
105 if (!areq->tsgl) {
106 err = -ENOMEM;
107 goto free;
108 }
109 sg_init_table(areq->tsgl, areq->tsgl_entries);
110 af_alg_pull_tsgl(sk, len, areq->tsgl, 0);
111

--- 296 unchanged lines hidden ---
105 GFP_KERNEL);
106 if (!areq->tsgl) {
107 err = -ENOMEM;
108 goto free;
109 }
110 sg_init_table(areq->tsgl, areq->tsgl_entries);
111 af_alg_pull_tsgl(sk, len, areq->tsgl, 0);
112

--- 296 unchanged lines hidden ---