Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1087705rwl; Fri, 24 Mar 2023 06:13:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+z5PoNMstb1s+vUfTbKVKZh/djChLuE+HKI/KIjJylJLNiGKL13t8VNHQxqdjwTKRU9eG X-Received: by 2002:a17:90a:bc85:b0:23d:816:faa9 with SMTP id x5-20020a17090abc8500b0023d0816faa9mr3146109pjr.12.1679663608990; Fri, 24 Mar 2023 06:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679663608; cv=none; d=google.com; s=arc-20160816; b=UITki427XjznOs1VXTD5AoqmiccFbSuIgEyX6BsP54Iy9X5wrHwd5yZwaVtbla4Y25 qpB2zTXUte8DV8zq0IVcOExZ06DQt0dP3Oa3hILYY4iTAU8YJ5HkCkhfQv7SpNzO1mD+ yQE5/5Dlf6nOaiW2vgkQqmMZVIY04fJTGuKBgYyR3jeCcOKqYyIzrmRn0O/iqLKiy4Jy 7W8qeYwSKEWwm9lF+gASti6rIJtsy5sPZTbbLN73TFVsdtDyVRr3BEOMBAzf319Vjw5e ieeT6+zSx4hO9HZwMbYl4+gmc7P2dcNHIq6T+8OrIHDhWDifF0NEb1xp1VEG4kI0/fEZ mu+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=H1rTPCT0JRH171gB57nXMD2YZ/LVQCyO8TbslkuqCTs=; b=a22jsJjMbDzCL1cE2c1O7dt8AMvSy7YU8Em5mmhI5TNSDqp1FqzudWH6zEBtTA5Rsw 8B9etFQ+QlBhjf4DAb5lED+50RKoSKAYHnG4R35EOfpTbZ7nxqp///rB8Evw4b1+VW2+ 35Rn2zj32VY4wjY2DqPwnMQbJoXLzNXgkY6/synZ8lFft8q8OCi1GA7plGPdkxhP2BCc XsmGS7UkfgqKW6Vk2JXLX13LqjFvKfMC1h2cCJuVF2KvO08smsxIx+zrsDGXlQsjRGWO eHhjnwsict2f7v61Kl4Kg5p5hvW4VMuwqPngl3RmS5h6+oC8UdCmSKXWjTqHhgQ4Xgb1 fjTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="fJhdF/6E"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a17090301d100b001a05a44093csi22838174plh.58.2023.03.24.06.13.16; Fri, 24 Mar 2023 06:13:28 -0700 (PDT) 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=@collabora.com header.s=mail header.b="fJhdF/6E"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231836AbjCXNCy (ORCPT + 99 others); Fri, 24 Mar 2023 09:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231477AbjCXNCx (ORCPT ); Fri, 24 Mar 2023 09:02:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E450C20563; Fri, 24 Mar 2023 06:02:46 -0700 (PDT) Received: from [192.168.2.179] (109-252-120-116.nat.spd-mgts.ru [109.252.120.116]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8A0A16602E0E; Fri, 24 Mar 2023 13:02:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1679662964; bh=kpqXq6UeGgXsVu6TLQM8ko29kV7748olljvXmD9n2oU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fJhdF/6EuVwtZqtUK9BHmxcGAPcgYm67pizoTOiLS9liSDI+PCTMcPyPeBk8giObt 6N51SXsvFnXt++WjdZLVZiBKxkCrEf3urnxFeWOwQaHqT1pxqh9M8a1IxjtCcKhU3d k7MFMRzZ8bzXLYC9jwq5TkCmdptLjCRdWSe/uQlUXSFwpLLJ+5u+GpP+UO16L2DpnU dUl+S4RWnEFc5tSuWFJT1WKLt5N+xstLYPLcN+K3CMNL8f7DKjRxEAEXTsDnaS7aYL Vr7Tog2S9Zg7P9ovovoOE1lojrwScdl3WKEZhgPXKrTnRJeD1wG6PV7NEvTvYlcqBm r1IDDo9CdQSqw== Message-ID: <5a16edd7-3e68-1f94-0ff1-24668fc43501@collabora.com> Date: Fri, 24 Mar 2023 16:02:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 2/8] media: videobuf2: Make bufs array dynamic allocated Content-Language: en-US To: Benjamin Gaignard , tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, ming.qian@nxp.com, shijie.qin@nxp.com, eagle.zhou@nxp.com, bin.liu@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com, yunfei.dong@mediatek.com, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, daniel.almeida@collabora.com, hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, jernel@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, kernel@collabora.com References: <20230321102855.346732-1-benjamin.gaignard@collabora.com> <20230321102855.346732-3-benjamin.gaignard@collabora.com> From: Dmitry Osipenko In-Reply-To: <20230321102855.346732-3-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 3/21/23 13:28, Benjamin Gaignard wrote: > + q->bufs = kmalloc_array(q->max_num_bufs, sizeof(*q->bufs), GFP_KERNEL | __GFP_ZERO); > + if (!q->bufs) > + return -ENOMEM; > + Use kcalloc() -- Best regards, Dmitry