Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1228089lqm; Thu, 2 May 2024 08:35:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuaVknyxgUQiBqWFPk2+Ozs2K/GWx59KFCTa/mQlho9luATK2huic3ckXTV9TfmA4PYP2SqPi5A3kbZgFStEcq8ttzEzrJYqIpOxRy5Q== X-Google-Smtp-Source: AGHT+IEdrX0b2pPZqbRs4GEc5R4mKNMSBZ6ZWOG2Ab2KB4dRl+fuodJBs3lDa80Ovd4SC/I4xEj6 X-Received: by 2002:a05:622a:5299:b0:43a:7bb9:db40 with SMTP id dr25-20020a05622a529900b0043a7bb9db40mr6649080qtb.27.1714664111736; Thu, 02 May 2024 08:35:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714664111; cv=pass; d=google.com; s=arc-20160816; b=Zicy3I2XWnKWcZ5VyEM7CF6iZ5F3Eh9SjxRXsN4mN3G6tWnfmzkvZJJHeX4gfsL9BC +iduEpNPhsxLCpbyU6ZWIg6fuNzDzRW4M5CKGvoUsCWXsprjai0+G018yBgrsijPtfC/ a0io8IJEz6OLS51PHu3fg233UecrE/NtRTY67ioRRvblOcfcSZtHP7coef35TCQx4z8X /zR7h+jEBRmBglt2JEjVBVp/a/3XIPu3YNCWghJHTVCsLs5DfS7Vb0iT+l3hEs1N7PTy VVHRq1MhK0dnKzXjq0IUXOFF1UsOze2MMhMcp2ffZ6PtCHuS6M8MdhCLMsz++zUFvoNV wlzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Ce5FXE5idr82jeqevYO8YWeQ0hM+JzLoZr03p3rxaCE=; fh=rhjRpD1xlY8KE51DJBg6D7DojjXGSxkf9EcF8Mdsx+4=; b=B8qunhK0TH8RYN/PVlb6JprcdKGR+9x8vmxSZUfcK3aZlxD7h//bdRdeQAVVuDjW8O l3VAoklmaxAay+9WSutF/1nv5Iqx5tZEwSWH7I9CIXcSMNDWkxbSIKxyb6p6TJC9RoH3 817dhlHdfS0OtC+JJn30M2ui4NF5fZq2eSRL1zb323qBrshWjnRuN7TtKVEZAd1dmvKf Wz8kOQTblDwaZackkJB+bCZWhniFgBkLc+eoULL8qoN9qsLYDAKH0DgnXj2lrGbl9Bp/ KblxFFZ6PGp4cC/l/To+EaBzexLJ9ARabhos4LGBp/ERdF+e69NnloZ8b/mNb2aP+S0z 2rMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=yScL0wg9; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-166651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166651-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o15-20020a05622a044f00b0043abd5b255bsi1235080qtx.414.2024.05.02.08.35.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 08:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=yScL0wg9; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-166651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166651-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6FADB1C21D62 for ; Thu, 2 May 2024 15:35:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A358615B117; Thu, 2 May 2024 15:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="yScL0wg9" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 C732115AACC for ; Thu, 2 May 2024 15:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714664103; cv=none; b=j7Qs35lB7yAljkl91thhd1BpSUtjJpn5aZURMK8xZCxcPoymdlovCUtTtl8+JGb78DGJDBEBPm1b76n5O3GL2wrDCPHtJ8wzMfIe6Xgp9+KxN35d/rBIZDTUl6Y4zJxFy+WE6vCRZXeGoBmqMhGC/sJt5242+VB1/w4zPz89Dw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714664103; c=relaxed/simple; bh=R+pJmmxpNrZ/XJxigie9GtGPdSpA3KgFHVA0wipAK7E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ux4JuYY2QidN20twapzV4KMnqJIO+bjYERWNNTcIoNpcPp+lnTWAJ8VVXjJovx0yF8AMBAcXpO2pHyepmDtbaQDo96ugXI91C52HSaSZSlqX8ALIMH6h/LsS+DQZngPfw10pWag31ka25+09cINH0C6JP1DkOOWX6Hx2iNnKiS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=yScL0wg9; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-572babec735so760586a12.0 for ; Thu, 02 May 2024 08:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1714664100; x=1715268900; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ce5FXE5idr82jeqevYO8YWeQ0hM+JzLoZr03p3rxaCE=; b=yScL0wg9qUChw1cmaZ3tDo4DHELgq6gUPBj5+tZ7W/eKXER+BT9WKBfsuWTWWDXL/d tkBSsxbh7S/DxXRT/a+KuLYpv54ihMRiljBcSetSqEZqGCoO3MSF5CB9BxIaDZl88Jet pP8aTSfeZioalHZ2rAohCiVBBoJ+mOovAXk52PwCh5/lLbi3eIfGHwZRgZDsBdrNcCgC CmeSqjp1YhEG3XQAO1QJJq2rPpY6H+j6EDIWLdW6A3JbPkANaPWtsLkeolS7Lu162gLU 2/Y4znvNX42IofJg7tBbZZpgkWHHmSnwTeSu1LMPtFxibFRskkyfpb6TBTAnI6aFPibC Cpmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714664100; x=1715268900; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ce5FXE5idr82jeqevYO8YWeQ0hM+JzLoZr03p3rxaCE=; b=XKfDhJ8DBX6RTmjZGK90GJGXoOvnBArPt1SMxYrWKzeKv7cDjXdZjBV/lVJGnkMkR3 nCsRgyl0lg6yP/KumPqkz3pMooYMiVMsC0olDqqp0etkRC1J0pOfB06Q/6huOFaHp8yW qxWDEs9CFGvsdTmypMj6DLB+kKzuFfP2cr64w1KmGFQeQhjzY1WoqBCaTvJ8N7vyS/vC /Ogx8VZuNUHvYMqWsf6MET2HXsImLMrATUe/rub2E5A4PuLJXMt1yfVQyp1DMxR2mpHs ZfveeIt87SKqJTUqfDeSn4K01aVuoMKNlIYzpbIMb+OazeEQZNrNocCBoTBIDIA/1h7J vrpA== X-Forwarded-Encrypted: i=1; AJvYcCU81ylHNCAzQDhAoQiwFoeg2gpvXHxTgP7rpxhgZkGD3zC8s+eM8v6drUDwLlfnvAwvjxAiBb4BA8qUEP1M9ZfUIRBRRRvh6JJbUx6q X-Gm-Message-State: AOJu0YxujNN0y1mCp/eDWpE/atviO88iDFbXs407ff6JHFOBUPGSxJsg zJVhFkVgi9rYeZJ+CzFeEvUICOjjDxT/zSsfEJTZSQQIsQAmuRUQmQ710iMwuLo= X-Received: by 2002:a17:906:6a05:b0:a58:7ddf:1805 with SMTP id qw5-20020a1709066a0500b00a587ddf1805mr3302521ejc.7.1714664100017; Thu, 02 May 2024 08:35:00 -0700 (PDT) Received: from fedora.fritz.box (aftr-62-216-208-100.dynamic.mnet-online.de. [62.216.208.100]) by smtp.gmail.com with ESMTPSA id j21-20020a170906279500b00a5587038aefsm675107ejc.156.2024.05.02.08.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 08:34:59 -0700 (PDT) From: Thorsten Blum To: Tom Zanussi , Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH] crypto: iaa - Use kmemdup() instead of kzalloc() and memcpy() Date: Thu, 2 May 2024 17:33:39 +0200 Message-ID: <20240502153338.6945-2-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fixes the following two Coccinelle/coccicheck warnings reported by memdup.cocci: iaa_crypto_main.c:350:19-26: WARNING opportunity for kmemdup iaa_crypto_main.c:358:18-25: WARNING opportunity for kmemdup Signed-off-by: Thorsten Blum --- drivers/crypto/intel/iaa/iaa_crypto_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index b2191ade9011..7635fbebe52f 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -347,18 +347,16 @@ int add_iaa_compression_mode(const char *name, goto free; if (ll_table) { - mode->ll_table = kzalloc(ll_table_size, GFP_KERNEL); + mode->ll_table = kmemdup(ll_table, ll_table_size, GFP_KERNEL); if (!mode->ll_table) goto free; - memcpy(mode->ll_table, ll_table, ll_table_size); mode->ll_table_size = ll_table_size; } if (d_table) { - mode->d_table = kzalloc(d_table_size, GFP_KERNEL); + mode->d_table = kmemdup(d_table, d_table_size, GFP_KERNEL); if (!mode->d_table) goto free; - memcpy(mode->d_table, d_table, d_table_size); mode->d_table_size = d_table_size; } -- 2.44.0