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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EF2DC00A89 for ; Thu, 5 Nov 2020 10:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB95521D81 for ; Thu, 5 Nov 2020 10:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/RC4QlH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730129AbgKEKwn (ORCPT ); Thu, 5 Nov 2020 05:52:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730061AbgKEKwm (ORCPT ); Thu, 5 Nov 2020 05:52:42 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654CFC0613D3 for ; Thu, 5 Nov 2020 02:52:42 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id k25so1072053lji.9 for ; Thu, 05 Nov 2020 02:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=d/RC4QlHsEU0Pk+87b5hebgQR1nvUbGfz+KWgyYPw8avJty+oHtYWwRBfI9ZwNnjQk 6x1f9VNEkjxS+WacQizm9QFnRFRoNTRgXz7J8hUL7gDHTr1r0B4CDTIH++hxOUWPbRHA faB9Z1G3wfURCCb570cPMFzwdpYsz5NNLR9grwb6NletLAXur80zPGuj6TnPTgqIsI6W 73tvdQLbSeHs/ZIHScGvMbbglljfvtEcmDpRr1SmCjt0Cs2115AxcxEJIltrAcsJpAIs i7f4CKXDgFTYIlx2Oia+shgKsQ9vbBqcm5RZnKYsE+6tO+5eUkPHBV9yZoGBsu8zWwxP sFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=L3+rPDKVOThsqvVHYGSiAr6jS3dybi12F/nryjhROlx4CZeozfGKz0QSSiil0Z2UpH tMdl4zENEzoEVMq3mJGfIhC0ktsSkK6LqTOtIFvEzvx7axBpjx4IUOREDKzsabL31BGN 3lp9ytyzlimM9v9/z+poaUVRzrA17sa5cN2yXxDXHlQAEU22qgkZ44CNujTcodw49zyv s8bKHgW7lcS4ZH2ZdavaQlZbyl5SGzkcuzihV/t1YZ3x0PvDKkhm8Ox421aiMD2EP4BU C178l8r76g5QzvkL36BJCtYzrvEkK1/iGprf+RYGsA/GTd+nhonkH2Zx3eWtLli0g6Mj WPXg== X-Gm-Message-State: AOAM530BqzdKR7Sy4gw+BVrsq2rUVViN1UG5qBAWgTvstyn9763U01oR z2Vt7YKywcwyFQwUEz/+IPgG4FvWml4gagoB06Xyiw== X-Google-Smtp-Source: ABdhPJwMZsQSFYx3yHXvvtRlVkabm7C64j8LuP2+XUU2+XVFwAx/DWoa4YDvNPprZ43yAgspd5XcguY3mqI1O9Ir5Vs= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr726163lja.283.1604573560846; Thu, 05 Nov 2020 02:52:40 -0800 (PST) MIME-Version: 1.0 References: <20201027121725.24660-1-brgl@bgdev.pl> In-Reply-To: <20201027121725.24660-1-brgl@bgdev.pl> From: Linus Walleij Date: Thu, 5 Nov 2020 11:52:30 +0100 Message-ID: Subject: Re: [PATCH 0/8] slab: provide and use krealloc_array() To: Bartosz Golaszewski Cc: Andy Shevchenko , Sumit Semwal , Gustavo Padovan , =?UTF-8?Q?Christian_K=C3=B6nig?= , Mauro Carvalho Chehab , Borislav Petkov , Tony Luck , James Morse , Robert Richter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alexander Shishkin , "Michael S . Tsirkin" , Jason Wang , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Linux Media Mailing List , "open list:DRM PANEL DRIVERS" , linaro-mm-sig@lists.linaro.org, "linux-kernel@vger.kernel.org" , linux-edac@vger.kernel.org, "open list:GPIO SUBSYSTEM" , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev , Linux Memory Management List , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Oct 27, 2020 at 1:17 PM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Andy brought to my attention the fact that users allocating an array of > equally sized elements should check if the size multiplication doesn't > overflow. This is why we have helpers like kmalloc_array(). > > However we don't have krealloc_array() equivalent and there are many > users who do their own multiplication when calling krealloc() for arrays. > > This series provides krealloc_array() and uses it in a couple places. > > A separate series will follow adding devm_krealloc_array() which is > needed in the xilinx adc driver. The series: Acked-by: Linus Walleij I really like this. Yours, Linus Walleij 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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C0BFC2D0A3 for ; Fri, 6 Nov 2020 08:45:47 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D267A208B3 for ; Fri, 6 Nov 2020 08:45:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eep6L2XV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/RC4QlH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D267A208B3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 043D8168D; Fri, 6 Nov 2020 09:44:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 043D8168D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1604652344; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eep6L2XVT3u3XPo30OfzboGcfxwZt6TXAEz8TPiSYvONGC18YY72HTb0XMVl+eK2G hY16G/z+iprpgbNiYZ6TMnzrFROXYxkaH9UpTBirmoVKyXOJDsQrO8PK8PfOIKgY2k SVPtKi4wdGKuHO1vhda/pGijF2V/fLavfd+3QApc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5423AF804C2; Fri, 6 Nov 2020 09:43:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65323F80171; Thu, 5 Nov 2020 11:52:51 +0100 (CET) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 28822F80150 for ; Thu, 5 Nov 2020 11:52:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28822F80150 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/RC4QlH" Received: by mail-lj1-x243.google.com with SMTP id d24so1070597ljg.10 for ; Thu, 05 Nov 2020 02:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=d/RC4QlHsEU0Pk+87b5hebgQR1nvUbGfz+KWgyYPw8avJty+oHtYWwRBfI9ZwNnjQk 6x1f9VNEkjxS+WacQizm9QFnRFRoNTRgXz7J8hUL7gDHTr1r0B4CDTIH++hxOUWPbRHA faB9Z1G3wfURCCb570cPMFzwdpYsz5NNLR9grwb6NletLAXur80zPGuj6TnPTgqIsI6W 73tvdQLbSeHs/ZIHScGvMbbglljfvtEcmDpRr1SmCjt0Cs2115AxcxEJIltrAcsJpAIs i7f4CKXDgFTYIlx2Oia+shgKsQ9vbBqcm5RZnKYsE+6tO+5eUkPHBV9yZoGBsu8zWwxP sFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=slAeaRJaqSAc2hZ0+EsERKEiWdY8hjB3oGhNmXtB9aq6HaBj9MZLH8YPbGnBwWBfcZ CI5De4BtOapqeTfEPvCtpjj1IulpUZzQIWzPUXRzs12JSkP7x4mLChF9Yus7++TgW3vU so/OhBL97u1tbdrcz9KNwvJyoguG8o3XvUh/TKNv4lT4ciafTVMh8guXzNzW5ox0hWqt 1EDLBGcdAqWDRv+v5GcQhYxzzkruea51Z5lEJba0nWSqKO9hU6ti7Q7O9BPDVGMTBYik i9uJH/oSqu0aYCZD/PRXMZRaEaJhqhMIgAwma6++U0gwk4S2r8F6gYonj1OnN6G/La8E AnEw== X-Gm-Message-State: AOAM5320HqLWe7AM6gDPsMOWeYl2MP2B+qosvxpjyCosBzhwtOkxvzxx O2YC8pN7nnWHMcJDU1yY4F0TI2ti+qzRy8jjmuXSNg== X-Google-Smtp-Source: ABdhPJwMZsQSFYx3yHXvvtRlVkabm7C64j8LuP2+XUU2+XVFwAx/DWoa4YDvNPprZ43yAgspd5XcguY3mqI1O9Ir5Vs= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr726163lja.283.1604573560846; Thu, 05 Nov 2020 02:52:40 -0800 (PST) MIME-Version: 1.0 References: <20201027121725.24660-1-brgl@bgdev.pl> In-Reply-To: <20201027121725.24660-1-brgl@bgdev.pl> From: Linus Walleij Date: Thu, 5 Nov 2020 11:52:30 +0100 Message-ID: Subject: Re: [PATCH 0/8] slab: provide and use krealloc_array() To: Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Fri, 06 Nov 2020 09:43:14 +0100 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , kvm@vger.kernel.org, "Michael S . Tsirkin" , David Airlie , Gustavo Padovan , Jason Wang , "open list:DRM PANEL DRIVERS" , Linux Memory Management List , Christoph Lameter , Sumit Semwal , Mauro Carvalho Chehab , Bartosz Golaszewski , Alexander Shishkin , David Rientjes , virtualization@lists.linux-foundation.org, Linux Media Mailing List , Robert Richter , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , linaro-mm-sig@lists.linaro.org, "open list:GPIO SUBSYSTEM" , Borislav Petkov , Andy Shevchenko , Joonsoo Kim , linux-edac@vger.kernel.org, Tony Luck , netdev , Takashi Iwai , "linux-kernel@vger.kernel.org" , Pekka Enberg , James Morse , Daniel Vetter , Andrew Morton , =?UTF-8?Q?Christian_K=C3=B6nig?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, Oct 27, 2020 at 1:17 PM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Andy brought to my attention the fact that users allocating an array of > equally sized elements should check if the size multiplication doesn't > overflow. This is why we have helpers like kmalloc_array(). > > However we don't have krealloc_array() equivalent and there are many > users who do their own multiplication when calling krealloc() for arrays. > > This series provides krealloc_array() and uses it in a couple places. > > A separate series will follow adding devm_krealloc_array() which is > needed in the xilinx adc driver. The series: Acked-by: Linus Walleij I really like this. Yours, Linus Walleij 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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785B1C4742C for ; Thu, 5 Nov 2020 10:52:50 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E97AF22203 for ; Thu, 5 Nov 2020 10:52:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/RC4QlH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E97AF22203 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 60AD186110; Thu, 5 Nov 2020 10:52:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N+BTGyMJOUwa; Thu, 5 Nov 2020 10:52:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 516088618E; Thu, 5 Nov 2020 10:52:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 39133C0893; Thu, 5 Nov 2020 10:52:48 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1744BC0889 for ; Thu, 5 Nov 2020 10:52:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F13BC870BA for ; Thu, 5 Nov 2020 10:52:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1MODsXsmTCUy for ; Thu, 5 Nov 2020 10:52:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id C6FFB8702C for ; Thu, 5 Nov 2020 10:52:42 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id x6so1094664ljd.3 for ; Thu, 05 Nov 2020 02:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=d/RC4QlHsEU0Pk+87b5hebgQR1nvUbGfz+KWgyYPw8avJty+oHtYWwRBfI9ZwNnjQk 6x1f9VNEkjxS+WacQizm9QFnRFRoNTRgXz7J8hUL7gDHTr1r0B4CDTIH++hxOUWPbRHA faB9Z1G3wfURCCb570cPMFzwdpYsz5NNLR9grwb6NletLAXur80zPGuj6TnPTgqIsI6W 73tvdQLbSeHs/ZIHScGvMbbglljfvtEcmDpRr1SmCjt0Cs2115AxcxEJIltrAcsJpAIs i7f4CKXDgFTYIlx2Oia+shgKsQ9vbBqcm5RZnKYsE+6tO+5eUkPHBV9yZoGBsu8zWwxP sFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=NsuNuMDgZk9TIp+xWojetfo08PjdmOwrGVLnA/2J7Kq1N407Q0aIMXTs55xxZAAE0m 4C6llSG5ov915gAh3Qm0UjO+U4z4kQWIcssFOYCDVac3vX5RoNrgSSYCqn6aIo0Fi3hy Ag4+Oe8dEw2g4HhH/vykD1Iq2FwrjurOcaQbh60XxW1T4+PworadMrQhygg5nO5lMq8s s6rPbwmgytjG7ccQQvLZ/FIaKN3G0+JZ7ug54IGk4DhCHSixDzhV+q072IhZo6EpnVVr SN8lxJrDOJI200iR4cRbwm0FEshsAYL/mkC7N6RuBuUwfq/PPfugtjnKUkYqKFVVOhLv uuRA== X-Gm-Message-State: AOAM530b2tJMkrN1t+Gfkw+CNJb6fDrYxZoOhR9NGf1wOI45dfcwR9Hn xW9YdVgJi0TLugXIp+2BjrJSTFLFD24hhz7FEzYUTg== X-Google-Smtp-Source: ABdhPJwMZsQSFYx3yHXvvtRlVkabm7C64j8LuP2+XUU2+XVFwAx/DWoa4YDvNPprZ43yAgspd5XcguY3mqI1O9Ir5Vs= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr726163lja.283.1604573560846; Thu, 05 Nov 2020 02:52:40 -0800 (PST) MIME-Version: 1.0 References: <20201027121725.24660-1-brgl@bgdev.pl> In-Reply-To: <20201027121725.24660-1-brgl@bgdev.pl> From: Linus Walleij Date: Thu, 5 Nov 2020 11:52:30 +0100 Message-ID: Subject: Re: [PATCH 0/8] slab: provide and use krealloc_array() To: Bartosz Golaszewski Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , kvm@vger.kernel.org, "Michael S . Tsirkin" , David Airlie , Gustavo Padovan , "open list:DRM PANEL DRIVERS" , Jaroslav Kysela , Linux Memory Management List , Christoph Lameter , Sumit Semwal , Mauro Carvalho Chehab , Bartosz Golaszewski , Alexander Shishkin , David Rientjes , virtualization@lists.linux-foundation.org, Linux Media Mailing List , Robert Richter , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , linaro-mm-sig@lists.linaro.org, "open list:GPIO SUBSYSTEM" , Borislav Petkov , Andy Shevchenko , Joonsoo Kim , linux-edac@vger.kernel.org, Tony Luck , netdev , Takashi Iwai , "linux-kernel@vger.kernel.org" , Pekka Enberg , James Morse , Daniel Vetter , Andrew Morton , =?UTF-8?Q?Christian_K=C3=B6nig?= X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Tue, Oct 27, 2020 at 1:17 PM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Andy brought to my attention the fact that users allocating an array of > equally sized elements should check if the size multiplication doesn't > overflow. This is why we have helpers like kmalloc_array(). > > However we don't have krealloc_array() equivalent and there are many > users who do their own multiplication when calling krealloc() for arrays. > > This series provides krealloc_array() and uses it in a couple places. > > A separate series will follow adding devm_krealloc_array() which is > needed in the xilinx adc driver. The series: Acked-by: Linus Walleij I really like this. Yours, Linus Walleij _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C545C388F7 for ; Thu, 5 Nov 2020 10:52:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED1AD22210 for ; Thu, 5 Nov 2020 10:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/RC4QlH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED1AD22210 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 019526E1F1; Thu, 5 Nov 2020 10:52:43 +0000 (UTC) Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 624BA6E1F1 for ; Thu, 5 Nov 2020 10:52:42 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id l10so1088889lji.4 for ; Thu, 05 Nov 2020 02:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=d/RC4QlHsEU0Pk+87b5hebgQR1nvUbGfz+KWgyYPw8avJty+oHtYWwRBfI9ZwNnjQk 6x1f9VNEkjxS+WacQizm9QFnRFRoNTRgXz7J8hUL7gDHTr1r0B4CDTIH++hxOUWPbRHA faB9Z1G3wfURCCb570cPMFzwdpYsz5NNLR9grwb6NletLAXur80zPGuj6TnPTgqIsI6W 73tvdQLbSeHs/ZIHScGvMbbglljfvtEcmDpRr1SmCjt0Cs2115AxcxEJIltrAcsJpAIs i7f4CKXDgFTYIlx2Oia+shgKsQ9vbBqcm5RZnKYsE+6tO+5eUkPHBV9yZoGBsu8zWwxP sFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IbC7h6sutytvBKVgRkW8YBm4v4oQThhwvuIz3XlFJpw=; b=ATl8s/YjRqZhzlQd0njaD20mRa93pbflyoa/2c8sUyTN0hv92cxNJpUZEf3Vtr12Pt ATAHNrCNoVdvaXnmH79oaAtTV25ywKIKjnzYCyXiwALWHofHmqUo9ihHr8LonRR+K12b BKYqRD2u+dHBwPXXytFbVVWZzHwcE0hU0p3AW9ZUyd4gTIvB92ga0PX416kr1Nv5zIEa GBEd0RMxqCIK/QWUDaUHsDNIQJC76mHIb1Sve5K3Z4pqFyKABfzTEomtnBiUt7GV3tVs ftGsRF7ZCXFs0GsVy6zaku1/1eeekKVtvve6K60mhhkrtQTSySwEVJiJDML1AwVltcZ8 L3Hw== X-Gm-Message-State: AOAM533u0Iap+QMjiYMJWuZBRsRXpTFqJ8A4YNbzUUpNuNCyROJXVBZx upV/wjje6V5G9elAQXiaOEUtc49KLIyRlgATmuGIvA== X-Google-Smtp-Source: ABdhPJwMZsQSFYx3yHXvvtRlVkabm7C64j8LuP2+XUU2+XVFwAx/DWoa4YDvNPprZ43yAgspd5XcguY3mqI1O9Ir5Vs= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr726163lja.283.1604573560846; Thu, 05 Nov 2020 02:52:40 -0800 (PST) MIME-Version: 1.0 References: <20201027121725.24660-1-brgl@bgdev.pl> In-Reply-To: <20201027121725.24660-1-brgl@bgdev.pl> From: Linus Walleij Date: Thu, 5 Nov 2020 11:52:30 +0100 Message-ID: Subject: Re: [PATCH 0/8] slab: provide and use krealloc_array() To: Bartosz Golaszewski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , kvm@vger.kernel.org, "Michael S . Tsirkin" , David Airlie , Gustavo Padovan , Jason Wang , "open list:DRM PANEL DRIVERS" , Jaroslav Kysela , Linux Memory Management List , Christoph Lameter , Mauro Carvalho Chehab , Bartosz Golaszewski , Alexander Shishkin , David Rientjes , virtualization@lists.linux-foundation.org, Linux Media Mailing List , Robert Richter , Thomas Zimmermann , linaro-mm-sig@lists.linaro.org, "open list:GPIO SUBSYSTEM" , Borislav Petkov , Andy Shevchenko , Joonsoo Kim , linux-edac@vger.kernel.org, Tony Luck , netdev , Takashi Iwai , "linux-kernel@vger.kernel.org" , Pekka Enberg , James Morse , Andrew Morton , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Oct 27, 2020 at 1:17 PM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Andy brought to my attention the fact that users allocating an array of > equally sized elements should check if the size multiplication doesn't > overflow. This is why we have helpers like kmalloc_array(). > > However we don't have krealloc_array() equivalent and there are many > users who do their own multiplication when calling krealloc() for arrays. > > This series provides krealloc_array() and uses it in a couple places. > > A separate series will follow adding devm_krealloc_array() which is > needed in the xilinx adc driver. The series: Acked-by: Linus Walleij I really like this. Yours, Linus Walleij _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel