LF-3093-2 crypto: caam - fix sm_test in case no job rings available
authorHoria Geantă <horia.geanta@nxp.com>
Sun, 17 Jan 2021 21:29:34 +0000 (23:29 +0200)
committerHoria Geantă <horia.geanta@nxp.com>
Thu, 21 Jan 2021 14:11:12 +0000 (16:11 +0200)
commit84a3940078b27aa00086f0e36f90c41fbe3f9410
tree3424fa74ca2c40b0fc0a05290fc2e082e9fe2914
parentfe1a75c890a0d8003de6e8def763c124b4ee4666
LF-3093-2 crypto: caam - fix sm_test in case no job rings available

In case no job rings are available, secure memory structures are not
initialized, since caam_jr_probe()->init_misc_func()->caam_sm_startup()
is not called.
This could happen if all job ring devices bind to the jr uio driver
instead of the caam/jr driver.
Running sm_test in this case will lead to a crash.

Add a check to verify that SM has been initialized - if not the tests
will be skipped.

Reported-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
drivers/crypto/caam/sm_test.c