diff mbox

crypto: dh - Consistenly return negative error codes

Message ID 20161108234822.29320-1-mathew.j.martineau@linux.intel.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Mat Martineau Nov. 8, 2016, 11:48 p.m. UTC
Fix the single instance where a positive EINVAL was returned.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 crypto/dh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Nov. 13, 2016, 11:29 a.m. UTC | #1
On Tue, Nov 08, 2016 at 03:48:22PM -0800, Mat Martineau wrote:
> Fix the single instance where a positive EINVAL was returned.
> 
> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/crypto/dh.c b/crypto/dh.c
index 9d19360..ddcb528 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -118,7 +118,7 @@  static int dh_compute_value(struct kpp_request *req)
 	if (req->src) {
 		base = mpi_read_raw_from_sgl(req->src, req->src_len);
 		if (!base) {
-			ret = EINVAL;
+			ret = -EINVAL;
 			goto err_free_val;
 		}
 	} else {