crypto: mxc-scc - fix unwinding in mxc_scc_crypto_register()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Apr 2016 10:01:39 +0000 (13:01 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 25 Apr 2016 11:14:53 +0000 (19:14 +0800)
commit4c048af708a8d562d02c5a2c8f46e01de6d81e34
tree1dea07984a6be9bf8d09d7b6302f3d7bf662cd60
parentb908bd3d4c4110a8a2ed84e2b6ab56fa7201db25
crypto: mxc-scc - fix unwinding in mxc_scc_crypto_register()

There are two issues here:

1) We need to decrement "i" otherwise we unregister something that was
   not successfully registered.
2) The original code did not unregister the first element in the array
   where i is zero.

Fixes: d293b640ebd5 ('crypto: mxc-scc - add basic driver for the MXC SCC')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/mxc-scc.c