| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Asynchronous Compression operations |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2016, Intel Corporation |
|---|
| 5 | 6 | * Authors: Weigang Li <weigang.li@intel.com> |
|---|
| 6 | 7 | * Giovanni Cabiddu <giovanni.cabiddu@intel.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License as published by the Free |
|---|
| 10 | | - * Software Foundation; either version 2 of the License, or (at your option) |
|---|
| 11 | | - * any later version. |
|---|
| 12 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | #include <linux/errno.h> |
|---|
| 15 | 10 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 33 | 28 | { |
|---|
| 34 | 29 | struct crypto_report_acomp racomp; |
|---|
| 35 | 30 | |
|---|
| 36 | | - strncpy(racomp.type, "acomp", sizeof(racomp.type)); |
|---|
| 31 | + memset(&racomp, 0, sizeof(racomp)); |
|---|
| 37 | 32 | |
|---|
| 38 | | - if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, |
|---|
| 39 | | - sizeof(struct crypto_report_acomp), &racomp)) |
|---|
| 40 | | - goto nla_put_failure; |
|---|
| 41 | | - return 0; |
|---|
| 33 | + strscpy(racomp.type, "acomp", sizeof(racomp.type)); |
|---|
| 42 | 34 | |
|---|
| 43 | | -nla_put_failure: |
|---|
| 44 | | - return -EMSGSIZE; |
|---|
| 35 | + return nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, sizeof(racomp), &racomp); |
|---|
| 45 | 36 | } |
|---|
| 46 | 37 | #else |
|---|
| 47 | 38 | static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg) |
|---|
| .. | .. |
|---|
| 118 | 109 | } |
|---|
| 119 | 110 | EXPORT_SYMBOL_GPL(crypto_alloc_acomp); |
|---|
| 120 | 111 | |
|---|
| 112 | +struct crypto_acomp *crypto_alloc_acomp_node(const char *alg_name, u32 type, |
|---|
| 113 | + u32 mask, int node) |
|---|
| 114 | +{ |
|---|
| 115 | + return crypto_alloc_tfm_node(alg_name, &crypto_acomp_type, type, mask, |
|---|
| 116 | + node); |
|---|
| 117 | +} |
|---|
| 118 | +EXPORT_SYMBOL_GPL(crypto_alloc_acomp_node); |
|---|
| 119 | + |
|---|
| 121 | 120 | struct acomp_req *acomp_request_alloc(struct crypto_acomp *acomp) |
|---|
| 122 | 121 | { |
|---|
| 123 | 122 | struct crypto_tfm *tfm = crypto_acomp_tfm(acomp); |
|---|
| .. | .. |
|---|
| 160 | 159 | } |
|---|
| 161 | 160 | EXPORT_SYMBOL_GPL(crypto_register_acomp); |
|---|
| 162 | 161 | |
|---|
| 163 | | -int crypto_unregister_acomp(struct acomp_alg *alg) |
|---|
| 162 | +void crypto_unregister_acomp(struct acomp_alg *alg) |
|---|
| 164 | 163 | { |
|---|
| 165 | | - return crypto_unregister_alg(&alg->base); |
|---|
| 164 | + crypto_unregister_alg(&alg->base); |
|---|
| 166 | 165 | } |
|---|
| 167 | 166 | EXPORT_SYMBOL_GPL(crypto_unregister_acomp); |
|---|
| 168 | 167 | |
|---|