android_kernel_oneplus_msm8998/drivers/crypto/caam
Horia Geantă 7b66838321 crypto: caam - fix endless loop when DECO acquire fails
commit 225ece3e7dad4cfc44cca38ce7a3a80f255ea8f1 upstream.

In case DECO0 cannot be acquired - i.e. run_descriptor_deco0() fails
with -ENODEV, caam_probe() enters an endless loop:

run_descriptor_deco0
	ret -ENODEV
	-> instantiate_rng
		-ENODEV, overwritten by -EAGAIN
		ret -EAGAIN
		-> caam_probe
			-EAGAIN results in endless loop

It turns out the error path in instantiate_rng() is incorrect,
the checks are done in the wrong order.

Fixes: 1005bccd7a ("crypto: caam - enable instantiation of all RNG4 state handles")
Reported-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Suggested-by: Auer Lukas <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 20:09:45 +01:00
..
caamalg.c crypto: caam - fix AEAD givenc descriptors 2017-01-06 11:16:12 +01:00
caamhash.c crypto: caam - fix signals handling 2017-07-21 07:44:59 +02:00
caamrng.c crypto: caam - Use the preferred style for memory allocations 2015-08-24 22:07:42 +08:00
compat.h crypto: caam - Enable and disable clocks on Freescale i.MX platforms 2015-08-10 23:18:56 +08:00
ctrl.c crypto: caam - fix endless loop when DECO acquire fails 2018-02-16 20:09:45 +01:00
ctrl.h crypto: caam - fix ERA retrieval function 2014-02-09 09:59:27 +08:00
desc.h crypto: caam - Remove unused JUMP_TYPE_MASK definition 2015-09-21 22:00:40 +08:00
desc_constr.h crypto: caam - fix warning in APPEND_MATH_IMM_u64 2015-07-20 15:53:43 +08:00
error.c crypto: caam - don't emit ICV check failures to dmesg 2015-01-26 11:34:23 +11:00
error.h crypto: caam - Contain caam_jr_strstatus() ugliness 2014-05-08 21:58:06 +08:00
intern.h crypto: caam - Enable and disable clocks on Freescale i.MX platforms 2015-08-10 23:18:56 +08:00
jr.c crypto: caam - fix caam_jr_alloc() ret code 2016-06-01 12:15:49 -07:00
jr.h crypto: caam - Add API's to allocate/free Job Rings 2013-10-30 12:02:57 +08:00
Kconfig crypto: caam - add support for LS1021A 2015-08-18 10:30:39 +08:00
key_gen.c crypto: caam - fix signals handling 2017-07-21 07:44:59 +02:00
key_gen.h crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
Makefile crypto: caam - Add Platform driver for Job Ring 2013-10-30 12:02:57 +08:00
pdb.h crypto: caam - Add define for Adjust Output Frame Length in PDB 2013-05-28 15:37:08 +08:00
regs.h crypto: caam - add support for LS1021A 2015-08-18 10:30:39 +08:00
sg_sw_sec4.h crypto: caam - dma_map_sg can handle chained SG 2015-10-01 21:56:56 +08:00