From patchwork Tue Nov 8 23:48:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 9418241 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EAFCF60459 for ; Tue, 8 Nov 2016 23:48:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDEDD28A00 for ; Tue, 8 Nov 2016 23:48:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D26D128A06; Tue, 8 Nov 2016 23:48:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74FE228A00 for ; Tue, 8 Nov 2016 23:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751677AbcKHXs2 (ORCPT ); Tue, 8 Nov 2016 18:48:28 -0500 Received: from mga03.intel.com ([134.134.136.65]:62187 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751597AbcKHXs2 (ORCPT ); Tue, 8 Nov 2016 18:48:28 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 08 Nov 2016 15:48:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,611,1473145200"; d="scan'208";a="1485320" Received: from mjmartin-nuc01.wa.intel.com ([10.232.97.135]) by orsmga002.jf.intel.com with ESMTP; 08 Nov 2016 15:48:24 -0800 From: Mat Martineau To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: Mat Martineau , salvatore.benedetto@intel.com Subject: [PATCH] crypto: dh - Consistenly return negative error codes Date: Tue, 8 Nov 2016 15:48:22 -0800 Message-Id: <20161108234822.29320-1-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.10.2 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the single instance where a positive EINVAL was returned. Signed-off-by: Mat Martineau --- crypto/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {