Skip to content

Commit 4179803

Browse files
ebiggersherbertx
authored andcommitted
crypto: cavium/zip - fix collision with generic cra_driver_name
The cavium/zip implementation of the deflate compression algorithm is incorrectly being registered under the generic driver name, which prevents the generic implementation from being registered with the crypto API when CONFIG_CRYPTO_DEV_CAVIUM_ZIP=y. Similarly the lzs algorithm (which does not currently have a generic implementation...) is incorrectly being registered as lzs-generic. Fix the naming collision by adding a suffix "-cavium" to the cra_driver_name of the cavium/zip algorithms. Fixes: 640035a ("crypto: zip - Add ThunderX ZIP driver core") Cc: Mahipal Challa <mahipalreddy2006@gmail.com> Cc: Jan Glauber <jglauber@cavium.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 91e1484 commit 4179803

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/crypto/cavium/zip/zip_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ static struct pci_driver zip_driver = {
351351

352352
static struct crypto_alg zip_comp_deflate = {
353353
.cra_name = "deflate",
354+
.cra_driver_name = "deflate-cavium",
354355
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
355356
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
356357
.cra_priority = 300,
@@ -365,6 +366,7 @@ static struct crypto_alg zip_comp_deflate = {
365366

366367
static struct crypto_alg zip_comp_lzs = {
367368
.cra_name = "lzs",
369+
.cra_driver_name = "lzs-cavium",
368370
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
369371
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
370372
.cra_priority = 300,
@@ -384,7 +386,7 @@ static struct scomp_alg zip_scomp_deflate = {
384386
.decompress = zip_scomp_decompress,
385387
.base = {
386388
.cra_name = "deflate",
387-
.cra_driver_name = "deflate-scomp",
389+
.cra_driver_name = "deflate-scomp-cavium",
388390
.cra_module = THIS_MODULE,
389391
.cra_priority = 300,
390392
}
@@ -397,7 +399,7 @@ static struct scomp_alg zip_scomp_lzs = {
397399
.decompress = zip_scomp_decompress,
398400
.base = {
399401
.cra_name = "lzs",
400-
.cra_driver_name = "lzs-scomp",
402+
.cra_driver_name = "lzs-scomp-cavium",
401403
.cra_module = THIS_MODULE,
402404
.cra_priority = 300,
403405
}

0 commit comments

Comments
 (0)