Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1079463lqb; Wed, 17 Apr 2024 22:13:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIT46JtMsWudO9EoWMOvq7Vz/hJ6D9CZdQeTpzz7VtuGk/mHB5Jr6EqFJgl5Yg2EuDTH5RMIps7SQn7rmk0iIzHaBes11kT1/LSsW4SQ== X-Google-Smtp-Source: AGHT+IHYZORicmCFznnQE0jA74d6yxWmaATxjswjrz1JymUu3+JXWL6trsYtLSDV7WHbh4EqStWf X-Received: by 2002:a05:620a:5221:b0:78e:df50:9eb0 with SMTP id dc33-20020a05620a522100b0078edf509eb0mr1622000qkb.42.1713417237658; Wed, 17 Apr 2024 22:13:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713417237; cv=pass; d=google.com; s=arc-20160816; b=Lnfjqr/F9t4t4NIRjyfiqPcnCqAqFF4/qSKGUqiI6rGMP8por2d/pi4tVI1djdMRG7 6amfZGuOHS9LhjXo2LcNsdeFe4IZUGRRHg83yJW1THgiR7wJQwYhkEB/4qznLCbCvxSd /X/an0wBw7qZ5qgsJfq8Ej9bmQr4ksWVH+PpJJDeD5lNzZjhXGCIT4M7xCrt0IXYtelM J+6UDWqK6fMTgRGYrBg54yMow46DN/1vRmmfEkIs34WCgvB4vFCOzZV+braM9MrwsUa3 wnNYF0ObI7TYZimZ+0j4aqw6h70uy9ktBErYtdR8Gwxz23p5hoYrXrTpraKkJfsaQv+p l1bw== 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:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=Klixwmg9FMSFk6pXi/BMfzbgAdTSHFv/a5BbbbevLUw=; fh=xdnfBdfmn3JdkHksV9cihIwZBs8JjiYjU9AoACvAec0=; b=YPumuRS0N/32rTF0sqb/m2aX8Bo45zRAPA99S2l6uv3DPxPzGulXfhKXN6kTessPit 2bO93hB64srArzi2auXIe57YRvon9iozAF2EO4s7HKSi0KKMUQVoYgsahtJ91LLcFcWp hxvX3Q/A4ubz7iXqT4Q38NINFiG46IyToOzwPspslkeUJIV0H0XkfJI4nu92EkyCa69K kXW9V7Eu73e89DqexIIIgOQMswlqJ/9SYvo2sS9Mcq2cOhtCXpSVHagHYrsY/cwc9X/c ic+z+q9xf3YMYCv9embEeDRQyjxttl9hy0CFZ5YjebMIudJeTj7RRvrvC2O/xXCnQmE2 5nBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sMb7TUzJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id op4-20020a05620a534400b0078d6491812asi713230qkn.584.2024.04.17.22.13.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 22:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sMb7TUzJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 60D3D1C213F0 for ; Thu, 18 Apr 2024 05:13:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F3C26A35D; Thu, 18 Apr 2024 05:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sMb7TUzJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7994F651B1; Thu, 18 Apr 2024 05:13:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713417207; cv=none; b=StrG/AX7QOodxSwth+Y+m3F4QeGc0pdM2iFZuclmMH+7hfxJibPYFNEavBSpx+ENjoRRxg2jBFgHvR9bwXrP+me2JDU52NGb7vkBRHbB++wjGEEPkOx2trqwlxz7OY87ZUE10TWKeJ2l/CTeFsdmES0VA+cqGbmXQkuIzbARqfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713417207; c=relaxed/simple; bh=gW1mGJDzIE0PdWXkGTdRMnEL0jMbvEIBiO9qTSGudOI=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=QfaKClcIFuLTxihWKAgWb+H1/uxzjIfvLmAcK8M3RIOMa3FwLVz8THbYgE5t6hi2T0r2Idjt3aSSlLFaZn2VMBaYgyIKPgjqCVRUmaUnHyHizG39PKZROHpmBnTod4iqZcraUI5PP0U09ggyE8F9H1WwkQ59tZRmrW5qYccTO7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sMb7TUzJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3A5AC32782; Thu, 18 Apr 2024 05:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713417207; bh=gW1mGJDzIE0PdWXkGTdRMnEL0jMbvEIBiO9qTSGudOI=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=sMb7TUzJQdA2Je+ck2wHeLIF6agHcjGlZHqELfQ0STL4V0G1sir0kpor2z2zE9oSl qgV64QJfHFqPUZ5IQPNNaYxm/T9xZoZAR/954drGewmn3aWnBFXhU1Vtfgydh+0brQ QvON4NuHtpE7/97s2dThhVFVr5mGDUnG9v9LFsZZz69GgIcYYKZJnkysdQIdErhLDi bCjKhSPN0E0bVo225dj1665RVuLYou/JW1cX+ryzwmmlkV+nA0zKBtOy3oD/mwXDyO bY4JiHKKAl/bwixOSoVr0gk3Y9uo9V+TjURuAkCNElIQCa/svm2sS9UzXrVNk4SzaI ADJ+YgXgRT0AA== From: Vinod Koul To: Kees Cook , "Gustavo A. R. Silva" , Erick Archer Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org In-Reply-To: References: Subject: Re: [PATCH v2] dmaengine: pl08x: Use kcalloc() instead of kzalloc() Message-Id: <171341720530.758041.12615273224606101090.b4-ty@kernel.org> Date: Thu, 18 Apr 2024 10:43:25 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.13.0 On Sat, 30 Mar 2024 16:23:23 +0100, Erick Archer wrote: > This is an effort to get rid of all multiplications from allocation > functions in order to prevent integer overflows [1]. > > Here the multiplication is obviously safe because the "channels" > member can only be 8 or 2. This value is set when the "vendor_data" > structs are initialized. > > [...] Applied, thanks! [1/1] dmaengine: pl08x: Use kcalloc() instead of kzalloc() commit: 98f2233a5c20ca567b2db1147278fd110681b9ed Best regards, -- ~Vinod