|
@@ -807,7 +807,7 @@ static int ahash_update_ctx(struct ahash_request *req)
|
|
|
* allocate space for base edesc and hw desc commands,
|
|
* allocate space for base edesc and hw desc commands,
|
|
|
* link tables
|
|
* link tables
|
|
|
*/
|
|
*/
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN +
|
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev,
|
|
dev_err(jrdev,
|
|
@@ -918,8 +918,8 @@ static int ahash_final_ctx(struct ahash_request *req)
|
|
|
sec4_sg_bytes = (1 + (buflen ? 1 : 0)) * sizeof(struct sec4_sg_entry);
|
|
sec4_sg_bytes = (1 + (buflen ? 1 : 0)) * sizeof(struct sec4_sg_entry);
|
|
|
|
|
|
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
- sec4_sg_bytes, GFP_DMA | flags);
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN + sec4_sg_bytes,
|
|
|
|
|
+ GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1005,8 +1005,8 @@ static int ahash_finup_ctx(struct ahash_request *req)
|
|
|
sizeof(struct sec4_sg_entry);
|
|
sizeof(struct sec4_sg_entry);
|
|
|
|
|
|
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
- sec4_sg_bytes, GFP_DMA | flags);
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN + sec4_sg_bytes,
|
|
|
|
|
+ GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1091,8 +1091,8 @@ static int ahash_digest(struct ahash_request *req)
|
|
|
sec4_sg_bytes = src_nents * sizeof(struct sec4_sg_entry);
|
|
sec4_sg_bytes = src_nents * sizeof(struct sec4_sg_entry);
|
|
|
|
|
|
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + sec4_sg_bytes +
|
|
|
|
|
- DESC_JOB_IO_LEN, GFP_DMA | flags);
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + sec4_sg_bytes + DESC_JOB_IO_LEN,
|
|
|
|
|
+ GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1165,8 +1165,7 @@ static int ahash_final_no_ctx(struct ahash_request *req)
|
|
|
int sh_len;
|
|
int sh_len;
|
|
|
|
|
|
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN,
|
|
|
|
|
- GFP_DMA | flags);
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN, GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1245,7 +1244,7 @@ static int ahash_update_no_ctx(struct ahash_request *req)
|
|
|
* allocate space for base edesc and hw desc commands,
|
|
* allocate space for base edesc and hw desc commands,
|
|
|
* link tables
|
|
* link tables
|
|
|
*/
|
|
*/
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN +
|
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev,
|
|
dev_err(jrdev,
|
|
@@ -1353,8 +1352,8 @@ static int ahash_finup_no_ctx(struct ahash_request *req)
|
|
|
sizeof(struct sec4_sg_entry);
|
|
sizeof(struct sec4_sg_entry);
|
|
|
|
|
|
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
/* allocate space for base edesc and hw desc commands, link tables */
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
- sec4_sg_bytes, GFP_DMA | flags);
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN + sec4_sg_bytes,
|
|
|
|
|
+ GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
dev_err(jrdev, "could not allocate extended descriptor\n");
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1448,7 +1447,7 @@ static int ahash_update_first(struct ahash_request *req)
|
|
|
* allocate space for base edesc and hw desc commands,
|
|
* allocate space for base edesc and hw desc commands,
|
|
|
* link tables
|
|
* link tables
|
|
|
*/
|
|
*/
|
|
|
- edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN +
|
|
|
|
|
|
|
+ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN +
|
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
sec4_sg_bytes, GFP_DMA | flags);
|
|
|
if (!edesc) {
|
|
if (!edesc) {
|
|
|
dev_err(jrdev,
|
|
dev_err(jrdev,
|