From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB589C27C52 for ; Thu, 6 Jun 2024 19:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qdeEl+caHTTOZH/UUBmluh3Ee51SLSZxJ/fjZYcuKOg=; b=a5PXZPfNI5rgPP fIdGaZeZVFzcrjU+LcUx9JNNfbfLbkLrqKl4axqO07CNzC1BQzeobFeSQZvXT0vZd0IoVKXZykc+G ESCSHzMxd03pZrWQkPrI2LaAh3HTlswCb4AziWuUK8tM1HgB5vbXtJfs6X1dggSAedyYagtcYX8lC zlccDm1aPjAQvVmF8kKy2ocnGcfUa8svkhoJrZjWmb9+8//NSQGsWTSc562jQC6fy0quxHnBu/4kn NU8UcYVwNcm3IJOtn28OYpJV+ZbBjoivrEscYsmxMS/F/1Lwzi/I6SPZLFEe4akEa9BrmoilamPKR Gq4l6rdgF5cX6I0h66HQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFJ14-0000000BA2q-2XQZ; Thu, 06 Jun 2024 19:43:18 +0000 Received: from mgamail.intel.com ([198.175.65.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFJ11-0000000BA2T-00Jh for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2024 19:43:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717702995; x=1749238995; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=iJ3PfJIIVmISWOs3yDhd5uulGCXgxOcN7cbPaPCX9fg=; b=VAEpJiavva2dvPhA8MSZ3qPYpahL+hnUPAB0qhTGygvEfK5saoRhGzcq yoCh3queyqE/ZIDvoCjqEsO5fmuhwrehQXZYNkvFWalMtQExn7tXqkso1 En4yNZdWeBTSqJMvCmawzf2SBqdB0L68itsgIWB5Vzv6RlGSRjJ39SK8m 9XZglNA6GM0MaAVJA+7FWeMFG7OFQyZ6BjhMZ5IES1jyhT9kszm54hwNx Yx9liYOc2VRjjDuL3nEDq63or5AKOXHduk5o+87d7qvLo7ib3yiawTG+p ovHxu/cKRKEzUIBKBZxEUngORcOq+ykytzXqVLcKZTCDfu7uxYqj4vxrK g==; X-CSE-ConnectionGUID: Q4sC+QDtQKelasbnx4SD7Q== X-CSE-MsgGUID: Df5TNwzvTYqEe3IPYvnDBg== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="18190221" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="18190221" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 12:43:13 -0700 X-CSE-ConnectionGUID: UCStVhN/SO2DSJLGK0L4cA== X-CSE-MsgGUID: KIifYad2QW+Pi4FxVy2Pyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="68868902" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 12:43:11 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sFJ0u-0000000EIca-0z55; Thu, 06 Jun 2024 22:43:08 +0300 Date: Thu, 6 Jun 2024 22:43:07 +0300 From: Andy Shevchenko To: Aaro Koskinen Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lindgren , Russell King Subject: Re: [PATCH v1 1/1] ARM: omap2: Switch to use kmemdup_array() Message-ID: References: <20240606165104.3031737-1-andriy.shevchenko@linux.intel.com> <20240606193202.GD9487@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240606193202.GD9487@darkstar.musicnaut.iki.fi> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240606_124315_175163_964358D9 X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 06, 2024 at 10:32:02PM +0300, Aaro Koskinen wrote: > On Thu, Jun 06, 2024 at 07:51:04PM +0300, Andy Shevchenko wrote: > > Let the kememdup_array() take care about multiplication and possible > > ^^^^^ > Typo. Aha, thanks! > > overflows. ... > > - hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); > > + hwmods = kmemdup_array(ohs, oh_cnt, sizeof(*hwmods), GFP_KERNEL); > > Maybe same result, but I guess the 3rd parameter should be count? Actually it is going to be changed to follow kcalloc(). https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id=0ee14725471c -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel