Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: tegra - Fix some error codes

Return negative -ENOMEM, instead of positive ENOMEM.

Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Akhil R <akhilrajeev@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Dan Carpenter and committed by
Herbert Xu
5ae6d3f5 ee2615fa

+2 -2
+2 -2
drivers/crypto/tegra/tegra-se-aes.c
··· 1156 1156 rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN, 1157 1157 &rctx->outbuf.addr, GFP_KERNEL); 1158 1158 if (!rctx->outbuf.buf) { 1159 - ret = ENOMEM; 1159 + ret = -ENOMEM; 1160 1160 goto outbuf_err; 1161 1161 } 1162 1162 ··· 1226 1226 rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN, 1227 1227 &rctx->outbuf.addr, GFP_KERNEL); 1228 1228 if (!rctx->outbuf.buf) { 1229 - ret = ENOMEM; 1229 + ret = -ENOMEM; 1230 1230 goto outbuf_err; 1231 1231 } 1232 1232