From patchwork Wed Aug 14 21:11:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13764130 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E2611C8229 for ; Wed, 14 Aug 2024 21:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669921; cv=none; b=l0W+dHc9Qk9yksRk/eGFQauc6Gi7UR6CG+s7XBlrHKNk0hIV1oM0nCVlnaFnUNA7Ebw2cOCfB9W8IQXEY1NKJy12HLrM2yAAUOgiBAKA22QONycHAOUmVkmV3IvjENOOyW6yK6hUfe5/N0N1epEhjeRZrl3P7iW2Eud5/V+Aj8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669921; c=relaxed/simple; bh=ycPuvrttB1C6BQ1ELjYP6wzk3vRUYi3s707GVRhkX0Q=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=XBsc1v5R5CAWLVk4aKbqXEw+VvbWM7JvxQJH3ComkVjNJKEPcDrVZNzAOSq2P3l1JPihIy8z7i/1ZhxePOI1sZiNF8VpwnQ/OXZctFinbMOqraiTKdpyUAvhSVqSiM2LidTlfwdUCV70O409HYTkN/GU0XE0EIhMiqiJqqg7Yzs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=pm5s9w31; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pm5s9w31" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3686b285969so168125f8f.0 for ; Wed, 14 Aug 2024 14:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723669915; x=1724274715; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=evmJCbr5KXjWqF9JXMvY5BqY0grGgRkrA3c6RXKRpdo=; b=pm5s9w31eZTMn7HDH2FCDvbYfN+6rH3zUEaEORXFXHT6uPqRTGJ+5JVWLnhS6M9YFc ENr4WdBtEcdCJym8erCbzCG28NrSXPBcuaK6A1CkO1VzgZw0GLopiiMe356K8NxjsfTX QHphOKLDyZgaKE9RTdnbw2ZDnlx03Oguj3Ug569iWYAAtQsD4HA7VL7by4sBjs+Uxwek 4NZGMYddnBwDa6gr32hOgXuHTfaeibRALgHP2elJRgp4Thk2gC3244bxpHx4nHbKpc3B JWc9OKlEro9P3WCzNjRwzr/84SZFlBO4xAzZKE6QsuHT9g4KECSBLNYMR/zmmLGDdXbh HKwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723669915; x=1724274715; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=evmJCbr5KXjWqF9JXMvY5BqY0grGgRkrA3c6RXKRpdo=; b=c1vXxdE5YW2Ecq0MCJbBJM/p+u1CJLY7lx0YWbltJN/uz4ZJkOblnq6EKJJ/Fsq3OB f4XRL6JhKrlmlT/RhLeXQuVjWph6lfc8HR7MW7tDF9y4f5vt0BqTxGrvKpcuveFjQ87P ACYjcpC6SeFn9alzjsngnIH18ICtV8uuVK6Gvzd6oLWR//OspOv6dJ+ER5O4YjJtVzEq OjgWiseA/ky1eZde5LIjzMc+BkGiyaasROMFFS5YhfPEe7yA4IW0Um7TM2a26xxwJ+L0 Piwecr4EY86iG8HKWa4ChaVFA3qUGnF2cCk+LQaX/9fZU4/g0C93mGNaFDGBqZGU/YQw 7Bkw== X-Forwarded-Encrypted: i=1; AJvYcCUhTr0QGwFcHILFgQGSB2rK3RLS8gezel7ujrCDlPEacb48k3gQGd7MoTqHscQw+9OI4QNLH+HmDU+bEPEUZl7lNTIYOINuJLFejwsf X-Gm-Message-State: AOJu0YyAp9JzbRk8wq1fZhT+jLmZCOj1/7NzPMvjie4w93sQSxzgpUt0 XGat721opmlTsu2Gi68kArx8krtNlHwEy3v6PvUH9lRxy/Ga7Bn6hkqxEw/Hne6jgyxqccVjzrb c X-Google-Smtp-Source: AGHT+IG4xQA7voZvyBkrr8JmB0I9Eo6GKpbi6HEwCJE+aA7CNONDvi13+K+VQ4L/iKeF3xsGk5ywoA== X-Received: by 2002:adf:ebd1:0:b0:367:9881:7d66 with SMTP id ffacd0b85a97d-371777fe292mr2891842f8f.41.1723669915521; Wed, 14 Aug 2024 14:11:55 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-371898ac2d1sm30494f8f.109.2024.08.14.14.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 14:11:55 -0700 (PDT) Date: Thu, 15 Aug 2024 00:11:51 +0300 From: Dan Carpenter To: Pavitrakumar M Cc: Herbert Xu , "David S. Miller" , Bhoomika K , Ruud Derwig , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] crypto: spacc - Fix bounds checking on spacc->job[] Message-ID: <3bab6e88-739e-43ca-894c-82c17e0177bc@stanley.mountain> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: This bounds checking is off by one. The > should be >=. The spacc->job[] array is allocated in spacc_init() and it has SPACC_MAX_JOBS elements. Fixes: 8ebb14deef0f ("crypto: spacc - Enable SPAcc AUTODETECT") Fixes: c8981d9230d8 ("crypto: spacc - Add SPAcc Skcipher support") Signed-off-by: Dan Carpenter --- drivers/crypto/dwc-spacc/spacc_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dwc-spacc/spacc_core.c b/drivers/crypto/dwc-spacc/spacc_core.c index 9bc49de06bb2..e3380528e82b 100644 --- a/drivers/crypto/dwc-spacc/spacc_core.c +++ b/drivers/crypto/dwc-spacc/spacc_core.c @@ -1024,7 +1024,7 @@ int spacc_set_operation(struct spacc_device *spacc, int handle, int op, int ret = CRYPTO_OK; struct spacc_job *job = NULL; - if (handle < 0 || handle > SPACC_MAX_JOBS) + if (handle < 0 || handle >= SPACC_MAX_JOBS) return -ENXIO; job = &spacc->job[handle]; @@ -1105,7 +1105,7 @@ int spacc_packet_enqueue_ddt_ex(struct spacc_device *spacc, int use_jb, struct spacc_job *job; int ret = CRYPTO_OK, proc_len; - if (job_idx < 0 || job_idx > SPACC_MAX_JOBS) + if (job_idx < 0 || job_idx >= SPACC_MAX_JOBS) return -ENXIO; switch (prio) { @@ -1331,7 +1331,7 @@ static int spacc_set_auxinfo(struct spacc_device *spacc, int jobid, int ret = CRYPTO_OK; struct spacc_job *job; - if (jobid < 0 || jobid > SPACC_MAX_JOBS) + if (jobid < 0 || jobid >= SPACC_MAX_JOBS) return -ENXIO; job = &spacc->job[jobid]; @@ -2364,7 +2364,7 @@ int spacc_set_key_exp(struct spacc_device *spacc, int job_idx) struct spacc_ctx *ctx = NULL; struct spacc_job *job = NULL; - if (job_idx < 0 || job_idx > SPACC_MAX_JOBS) { + if (job_idx < 0 || job_idx >= SPACC_MAX_JOBS) { pr_debug("ERR: Invalid Job id specified (out of range)\n"); return -ENXIO; } From patchwork Wed Aug 14 21:11:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13764131 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A40221C9DFA for ; Wed, 14 Aug 2024 21:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669926; cv=none; b=ot/bJAcvmmp+BqcQA/QMj+4thyYZPCEsavCg9dQEXRu8/8sFc1/ubVYkFddo3ekJneKZ1VD0E12BLQ9KpF5fOj3jPNw5rYU60cIsx6vjjVH8RJb9U5t9NGAgYeELhAlObWFuHsVSss24fK/QPT3stAhKNrsFrZMz5F8UObqi7xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669926; c=relaxed/simple; bh=2GDAnPXDCO8WsPQJmInY0Nku6B4q2ax/ORM0Ijp/ysM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=RViAnzjp8PO04BxbL7Eq2UCRlgn3QYPkWSp3eHzc9M5Wd7bmCHMcOPxYbHP8meP75jiH5QwHNQkL+pSG9p2d24xZLYI/DMsW0SlahN3cqbG6Brz8dxng+SoKX+58PpHMaZSefSIsQ52UEKi6Cxd2ycjyhRGoQmcK3fuUhS04AZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XYMT06+U; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XYMT06+U" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-429e29933aaso1327015e9.0 for ; Wed, 14 Aug 2024 14:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723669922; x=1724274722; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wnecrCBfNMIqTbazGYk50cWogArEuWoUivR0Jks7i3o=; b=XYMT06+UGYlGN1lEb96xSOoSQqLDnN387B8X2EYAvcTNUkzJno082TZ6PMfosQRUoL l2vhewnEfHIT1TcP0K7uxD1poexJRAtNwRmKRCCqdObbFXmR6CaVO3G/lkkIyN642MTH IgCW1OgAPZq2iOoWOq+j2Qq+rQ9sqdECnrN5P8hpZByPCD8VPdz3OOvHyFLu8L2fjj8z 6ILlOKHm5qyym8uaFjUC+0qXiPwG7LWt66GeB94mSc3zjYm4qJsOPklpymJaHuchKQVV 3Bkfo2D6BVpU6yMKDvr0C3p2/PtNkHLiia7BpK9UrU1Ml9NZTbkxTsamK2FcDQppObLd xSrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723669922; x=1724274722; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wnecrCBfNMIqTbazGYk50cWogArEuWoUivR0Jks7i3o=; b=GwrVTu4rC0qRjmhY/9r4mGDZVJmmGq/ah0SaIINpgptWmhPy0kUNnR3cjTcljhMkLC yerLEHDUcOOiVqe8cy8rxnQpZ6vEh9519SJlUK1BQS2q6ceyRTzsHjgNjXFGw3yCJXFy MmhPTSFJnT0KgWoWWEvXsZE15tw/asF1hHCYdjX38V7F+d80Lk9SQIhUXHvNMEEd8mWx rcVUyq+eIZsBZ/HEziwRFm1+B5WQ3E6PoTLXnrbmg+YcQE5+9JHXoQeUuN8FbF4oMm4n XFDONcwXjwAVml/GExVMH6Q4AldOR9Y7IkWmt0Db0pp0Ir86y5BnmDkyD0OHF3xY5MEz Fd7g== X-Forwarded-Encrypted: i=1; AJvYcCWtOa/bf1TPwtiwKHNBw1lqVtnAyNOHmXVdCfMb8ynrETjyhcO1CoVm2K+jc5qbQ/0xA9zCOvXHiPS/p9GoBS9t4r2LCcHvZ/sUmsUl X-Gm-Message-State: AOJu0YyLTmGihrOkFVcG9F0SHjtPAn3lUIKZEJfEMhuE+/e9Mat+FhHP V9Gr41bwFM6Du3QlVjCUaUp9dr4DL24meFV/8BxBVNhfuviS92ndc1iZYI+FnTE= X-Google-Smtp-Source: AGHT+IGT4QskXd6JH+wwlH+mb1PDuD4UMLNo4ckVVpaOKI5SBci3hdH8HmXXfH/EyMzKqk/UWE9jnw== X-Received: by 2002:adf:ec52:0:b0:368:5e34:4b4b with SMTP id ffacd0b85a97d-37177768ef1mr2577439f8f.6.1723669921933; Wed, 14 Aug 2024 14:12:01 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189849a05sm40860f8f.26.2024.08.14.14.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 14:12:01 -0700 (PDT) Date: Thu, 15 Aug 2024 00:11:58 +0300 From: Dan Carpenter To: Pavitrakumar M Cc: Herbert Xu , "David S. Miller" , Bhoomika K , Ruud Derwig , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] crypto: spacc - Fix off by one in spacc_isenabled() Message-ID: <6327d472-b4d5-4678-b54c-9808a68e3504@stanley.mountain> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The spacc->config.modes[] array has CRYPTO_MODE_LAST number of elements so this > comparison should be >= to prevent an out of bounds access. Fixes: c8981d9230d8 ("crypto: spacc - Add SPAcc Skcipher support") Signed-off-by: Dan Carpenter --- The CRYPTO_MODE_LAST variable is poorly named. Based on the name you would expect it to be the last valid value but it's not. (I'm not a huge fan of code which uses the last valid value instead of the size personally, but the names should match). drivers/crypto/dwc-spacc/spacc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/dwc-spacc/spacc_core.c b/drivers/crypto/dwc-spacc/spacc_core.c index e3380528e82b..b7630f559973 100644 --- a/drivers/crypto/dwc-spacc/spacc_core.c +++ b/drivers/crypto/dwc-spacc/spacc_core.c @@ -1295,7 +1295,7 @@ int spacc_isenabled(struct spacc_device *spacc, int mode, int keysize) { int x; - if (mode < 0 || mode > CRYPTO_MODE_LAST) + if (mode < 0 || mode >= CRYPTO_MODE_LAST) return 0; if (mode == CRYPTO_MODE_NULL || From patchwork Wed Aug 14 21:12:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13764132 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39E591C9EB0 for ; Wed, 14 Aug 2024 21:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669933; cv=none; b=ohxxqCxPdmSY9gQup+XfwWkPe4tucDIRSeCj/+2cMQ5vDvsAhMPpLdE+OuY35ApkBQQfJyN2blNDkk5M1EjL2NjzFzL25b+SnV5fhPuF/3OXKqSC/7cLnX5S9dfAF1hhNyx5o/lY9E8BVaDeCpvYMtGZXXePANbEwnLA32JTNew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723669933; c=relaxed/simple; bh=NrYy3KCJ93XBrlv0fDajDdUpZNCCuP92065pd5XQ7L0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=hieV3wezdMLAVZnfdRN32ELfVndReVDvABPd1LRlZkgs71Q4QlQdKx/6Qdt4TU1ceU2RTSwzYViB5S85DFChOemsXHAHC126ZlNZFuXEJEKZwbZYKhgUPqCjEVvrduTBbfqZKnRXfqTvXBSPp0lXVC4Y8K95hiyzGiwXb8Ln+K8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TGiOsIRo; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TGiOsIRo" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-368440b073bso160755f8f.0 for ; Wed, 14 Aug 2024 14:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723669928; x=1724274728; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DvinTXy1Pu55Z1s2JUlMWc8o/CYhTf2Gu4R5avb3VKA=; b=TGiOsIRooyHcS0msmiFeN891Da1wTkpXIWki0edp2EJhLLJ5MfAF2+UaqSC7QZqsjq P4pG3F4eXgjKsYFGFNc8arEneEmNwa2Sk9X+2G9pkyhO84FPDWYW3MI0ykjj/ZzReNqx Porr53d+ZJxTxO6HUganSeTyl0D5o0hutV1elxJW5L0KjR7JZQOrAS/7x0bp7WuCID4r I+XxvjEgk+0K8kqORFkKnCfB7H85kEglUhfwVAH8zA9b88YTdK7JCd18LbfJoYpnF5o0 Rz7QnFMOX7h4UlWrQ0LjfDy3GZPaGINO3ymfbvcoO4eI/YHsPdKQ8trmkfCJUiMauFiF leWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723669928; x=1724274728; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DvinTXy1Pu55Z1s2JUlMWc8o/CYhTf2Gu4R5avb3VKA=; b=YhoWmiwJsmsBAAfoORc3pPNBFPYDHq3b91gFrlwj5uQPJ1jiGEVLmrubqwW1ixjasg UL8D6AqwXn4fm5Xjtm9GScOW2PVtzLdny+QQigFbgJAvBr2S6XyAih2alHY9LYdoyLAM k7tXYJL7zGzk0mpslGTkp7Nf8goD68XM6LEv/HGHr3UWrcg1h31YcJpe6sg8Mc3nvdzd yzm9syyQdHuk/vvh9DEA2EFmhUFnC4VjLCRi8EFD0G3Kir/N1hVGpqcVJZQDAM9fuTrh V+JBGQQeaXMKXoYbkUCNo4+eRAMtqfQEF2jco+ae/cjsTE83igQHhShfsOb8Yx3o2Lvo wzKA== X-Forwarded-Encrypted: i=1; AJvYcCW1xbvMPo2rtEuw8HQ7o9lXHUQXkCWvUxN7KtUzTmc7iQF3JWX7GsnjzX+LLcm0hH7Z3fWhJVmiCVAsjLLSSYkvjpcBP63ADKi0VwRC X-Gm-Message-State: AOJu0Yzu5pvTO6AA8jn2fURkpQaO28UQQMDxmZR1QT2b9do+cRDU3105 phfGznzQgYhyV157MWqS2fio+zV6Lpc35ZN74N0AtOpF7KjCY0E5MAVNCD2AFa8= X-Google-Smtp-Source: AGHT+IH6g79uU3REsY1aYPRVUa3GzDJE31zY/2sWg+HmnohPnve8H/2pByk8jsfDM46XuWz95tP5uQ== X-Received: by 2002:adf:e609:0:b0:36b:ea3c:5c00 with SMTP id ffacd0b85a97d-37186bea9a7mr629717f8f.9.1723669928337; Wed, 14 Aug 2024 14:12:08 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429e7e1c5f2sm1477435e9.40.2024.08.14.14.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 14:12:08 -0700 (PDT) Date: Thu, 15 Aug 2024 00:12:03 +0300 From: Dan Carpenter To: Herbert Xu Cc: "David S. Miller" , Ruud Derwig , Bhoomika K , Pavitrakumar M , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] crypto: spacc - Add a new line in spacc_open() Message-ID: <6e603578-2250-4ace-aa43-818b8f23e2e9@stanley.mountain> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Put the break statement should be on its own line. Signed-off-by: Dan Carpenter --- drivers/crypto/dwc-spacc/spacc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/dwc-spacc/spacc_core.c b/drivers/crypto/dwc-spacc/spacc_core.c index b7630f559973..b9e0d3227f81 100644 --- a/drivers/crypto/dwc-spacc/spacc_core.c +++ b/drivers/crypto/dwc-spacc/spacc_core.c @@ -1904,7 +1904,8 @@ int spacc_open(struct spacc_device *spacc, int enc, int hash, int ctxid, ctrl |= SPACC_CTRL_SET(SPACC_CTRL_HASH_ALG, H_SHAKE256); ctrl |= SPACC_CTRL_SET(SPACC_CTRL_HASH_MODE, - HM_SHAKE_KMAC); break; + HM_SHAKE_KMAC); + break; case CRYPTO_MODE_MAC_KMACXOF128: ctrl |= SPACC_CTRL_SET(SPACC_CTRL_HASH_ALG, H_SHAKE128);