Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp526175pxb; Mon, 7 Feb 2022 17:49:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJydEzLjgPeWa85fFXAy5AWRLp9G41UGz+o7Go/T+FDTlxIGVt85YbCf0AAPo/3Y3UvRcVXl X-Received: by 2002:a17:907:961c:: with SMTP id gb28mr1859935ejc.725.1644284976286; Mon, 07 Feb 2022 17:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644284976; cv=none; d=google.com; s=arc-20160816; b=MDWthWI9fBzIL5H/bXya8khOhHfLquY8XooBQeX3bQsJT8PQHV/4tRKMI3bDobgyPy z1L/O4yLGx3Ane7MT/MA6rDx7NbgDM2zt+P1zAfeY7ZeDiKSaaaah7Ubzr5hbTiZiWLA 0Mi4wznRgDnWv+CftUuGMxyt9BceRzR881xMrPv0NDtqEVqb/NDoB8y5xrno/2SqIm4s TKK7QW9E/HF5bsXeeOGA9wPlhapB4DO5UosDkUj1LO2CMMtNr/DwvN+lzu5y1E6qeFCc WQNsXH/o3ckye0xxACdbM+9b4jaL6EmBBWbH/CKNkIHVBhaoIGu354tDzGq+EyLlJQXD JgfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Np4LH/PHz6uNkDpTZmQ/zoxgwDp96GbmnvDa2V7nWjk=; b=CJV2hC0hS5B3lcOV1MV9xQ5l2krDM03+xrJ/wMKkgLCzkRXU/1aGp4l5uOHq9JVJoV F78R5QXkZm8A0Uy0wSsrDQ4dDYHI6HZuXAyyd+xFql7OhbGhGjLtoR+uWB8tzMkgy0H4 L/fOagduoBClN+QgSPYuZaKCY+LL3mO57QhmYX+uknq5Nz2tfLL6xY14mquoVMZ17RH2 UTPohAsZAZ5O4oBxCIhfW4JEhYjAm0gFdDs8YUX4s/tWR99qyijurLdSdZyFsHgTnSW8 QLvW1p6kpVDBd9nzzexW+1xj7P0s8rDJfbEM6L3DS8i+FpqRm0duki+hZVDCuTN5NQXf Xpng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QgufGM+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp13si8036443ejc.971.2022.02.07.17.49.11; Mon, 07 Feb 2022 17:49:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QgufGM+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386995AbiBGQae (ORCPT + 99 others); Mon, 7 Feb 2022 11:30:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345722AbiBGQVN (ORCPT ); Mon, 7 Feb 2022 11:21:13 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77887C0401CE for ; Mon, 7 Feb 2022 08:21:11 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id u23so1987409wru.6 for ; Mon, 07 Feb 2022 08:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Np4LH/PHz6uNkDpTZmQ/zoxgwDp96GbmnvDa2V7nWjk=; b=QgufGM+1w3bsYZSJ9xlKRmy3+TsigV3ZsM/lqCkrk+2PFrRq2qAxjaRIcbaZ6XTMpd dHN3csVfUdJlhnr4ISuVdfwWYthqcjlVkwEKaIzb9ohnAgPPPEnUh8ZXbwWBB4FE5VTD v4qiUp1+V61ZK9GFt06cQBjo9kwCIXouNxnx1dWjOOpSi6rvXPFsU0oBn2JtQQ8qDYSE JTzdjg3Q550FQW+DQ/yUhMrzvS9yoNZmt/a2M2/z7siYRPqcfv6jjVIuNkLoSpWuQ8d/ sOwBN4knqfQHkxWpOzloC+DeoSvsFYb63wY9gAxv2vVkHqYOCumGB9afLCGKIFbX2MJ5 xl2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Np4LH/PHz6uNkDpTZmQ/zoxgwDp96GbmnvDa2V7nWjk=; b=xTCqIa5jsKhPp+GyJUWfhlV/HjGWNTXqz7zGGuXbEW+2TzrAj6GsGTgJNevbCqH/EN m+vgcdmtSCYj3aNTMAx/LKCpdnwMcq0qBrl+ANYZ4ZyFpBXPR/t2S8wI+MkfxNLzG57s NiKdvxdNPpgeueoISpxu955HQ7d/tP15Z1qcr2qAFmHIo7vS3cGKUkepTIwPgsewq9YT A5WStzHd65xJyCHDWQV0DA6xsOpHmOUmxAyjggoT013tGRTaApZsWEs/4Lm/BRdLVcvg 6ONCUWHZ8ZZTB3wBPF4v0P5PqoRwIsIsvTIIDuH6GWnng7q8a2gToAktwZsCbdBtHUDz 52CA== X-Gm-Message-State: AOAM533hl3/r6XaVpgVJijNyLxacHsZg50hBYJa/M39/EZmfVg50MYxR NtfCQtJxkIPhcAm2dFOyI/kY5w== X-Received: by 2002:a5d:50c2:: with SMTP id f2mr173218wrt.694.1644250870003; Mon, 07 Feb 2022 08:21:10 -0800 (PST) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id k9sm9789271wrv.81.2022.02.07.08.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 08:21:09 -0800 (PST) Date: Mon, 7 Feb 2022 16:21:07 +0000 From: Daniel Thompson To: Christophe JAILLET Cc: Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Lee Jones , Jingoo Han , Helge Deller , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation Message-ID: <20220207162107.eblu6rxyhkuyyqnf@maple.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > a multiplication is needed to compute the size of the requested memory. > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). > > Signed-off-by: Christophe JAILLET Reviewed-by: Daniel Thompson Daniel.