Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2806029lqp; Mon, 25 Mar 2024 09:40:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLkF63DpGmNtv4ELF7H4iGTWyYk3+EaPl/4g6s/WQaJZWBW40w72lZ2ws4eJToe2oJURNhnV8YdOfi31319LGjLvu+WLs71HUu93loJw== X-Google-Smtp-Source: AGHT+IG1Jca40g0A9JGLQF7hmuJHuB7qK1TwKEwyoOe/ek3/iMAjH7OHaykDyeBIwMSQgo11gfKA X-Received: by 2002:a05:6808:20a0:b0:3c3:bf97:ca2f with SMTP id s32-20020a05680820a000b003c3bf97ca2fmr9066924oiw.6.1711384834979; Mon, 25 Mar 2024 09:40:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711384834; cv=pass; d=google.com; s=arc-20160816; b=VNsViNPuC14423mdmuIIej33aDM/WXS+oizBn3ySyOFFrBqkKumUzTQm4izPnl1/RZ 21QUO5J7dBct43MIriCG12x5fcLliT2nHpYci2qNcTs/xj92uywLw2YjRC7rPckHligo qVL9vWEu2OF5NI3BW8dvytzmF3VkP75U+UxjNpyFwpyR7U7BmnRMuM02BWe5sPBzrhtk vgyc3kYKqCP/fHXHYjtzCuRDwO9YKDGuUOJ7pItQsOw1f8pCVJ7VufNTYRcmQ7n0L1M1 4DB+MMEGnJvRO5HsSAVICnYqBp1fpFnUnsrH0XjyuG96RvXQeM+1J8VD6caAw+2jvxTx Zzgg== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=hOoDjVcGRmFMzZwxqBiMD5JzXHNjwrfYtPzd95vutmk=; fh=OUYDUqZsLmwPDLhy1zu88Hhlrt1YS/XiLmIkBAa3jeI=; b=NjPvpx9MSM3y+r3nJUXfnxtaCET6t8owT8TF9XWgdEJLKCEQFz+zSjeVFNEitutz4z OHYTPyLh+c2k1oox1N41n5DNEEOWEWoN1rxxAMGav7UNqgIViU0kB8pLvgK+M1Ippr9p eqSmds9b6ViPpUpqOLQSpNOeowf5VIkE8HCf3Wi52e63H621ExBkZ5KM53vMQKm9klaL 211BPqppi2hAGRybwkneACf5M/gohxd8PFH0DUr1w7+OqBIFjQFPgX9lmfJuawoZ7ZAw ozR2mJLRJjc86iGHT5SNjChMVxaGayeAEUosZKqL8XXB/lMG1EHy9eDKeliKslBxyS0Z QGVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GRcNMnXS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-117282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q18-20020a05620a0c9200b0078a3a95c3dbsi5630214qki.106.2024.03.25.09.40.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:40:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GRcNMnXS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-117282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 7F46E1C3F3B4 for ; Mon, 25 Mar 2024 16:37:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E84CD154C1C; Mon, 25 Mar 2024 14:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GRcNMnXS" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 979DC12CDA6; Mon, 25 Mar 2024 14:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711377859; cv=none; b=ppfsWF4nm36o8fqpobiqHu90RjTAcEg6KU1M+5U8/n7Zc0CfzaAEL1Z83KjQiyWl+FFOmgdKNNO1QgCjF7AQvwHYtoHyY8yJXpdsyonohpMlAn7tCWz+KPjy4NKKmPWSQz5cHRd2IcpR7zL95x47Wuqax/ZqJgPw+sBHkgE7Jg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711377859; c=relaxed/simple; bh=QsNB623Lmca7ppvFa4bARafHWQQzNtKPQ9ez856a9rc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z6tu+XifqqAxLpX+uPT0Em6cphmtEsERyQtuo5o+Nqo57xw2X2g7lDiqEXlZ1/jnfP01MjfxHaqG0Sjj/43ZRttaehA8a97UI7JUr/7Mr2hBnGmTaRuhmJTgBb7CO8nICux6ZkUMOgtX4LQY0mrUA32DqzUS6Bx0dpm+IFXbMoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GRcNMnXS; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id BDF53FF811; Mon, 25 Mar 2024 14:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711377854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hOoDjVcGRmFMzZwxqBiMD5JzXHNjwrfYtPzd95vutmk=; b=GRcNMnXS6gTc5IgNbIo6ezfvOU6pDsL8d7x2K6AbVCNthUBG+ADjrllXftMJaZqwKXsUQY ALkjwITOwvd+2MouoX4CBjpnyEEjuSGKkKLhCpGY6vIVBiHh1ubF6nJc0Fhr6Gwby8NE4e fMQ7BiylwG6v909kKXdJrsm+2xEC+akcQObB704TKTCCDbuKTS3iR/zK4CMvMHF6VH97eq FRuPIE3IElqrvytG24PMdfnu/wtOHGwV1SAjICB5YzLe0Ryr0yYzgWPBWeWBty55XLM0NP XeE58OJHGquI0f1Amg77Pusaa7e75waAxroMfsJIONu7UZozu+EKxZuP0URE5w== Date: Mon, 25 Mar 2024 15:44:12 +0100 From: Luca Ceresoli To: Ricardo Ribalda Cc: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] media: dvbdev: Initialize sbuf Message-ID: <20240325154412.0b768835@booty> In-Reply-To: <20240325-gcc-arm-warnings-v2-3-47523cf5c8ca@chromium.org> References: <20240325-gcc-arm-warnings-v2-0-47523cf5c8ca@chromium.org> <20240325-gcc-arm-warnings-v2-3-47523cf5c8ca@chromium.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) 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: quoted-printable X-GND-Sasl: luca.ceresoli@bootlin.com Hello Ricardo, On Mon, 25 Mar 2024 14:19:55 +0000 Ricardo Ribalda wrote: > Because the size passed to copy_from_user() cannot be known beforehand, > it needs to be checked during runtime with check_object_size. That makes > gcc believe that the content of sbuf can be used before init. >=20 > Fix: > ./include/linux/thread_info.h:215:17: warning: =E2=80=98sbuf=E2=80=99 may= be used uninitialized [-Wmaybe-uninitialized] >=20 > Signed-off-by: Ricardo Ribalda > --- > drivers/media/dvb-core/dvbdev.c | 2 +- > drivers/staging/media/tegra-video/tegra20.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvb= dev.c > index 733d0bc4b4cc3..b43695bc51e75 100644 > --- a/drivers/media/dvb-core/dvbdev.c > +++ b/drivers/media/dvb-core/dvbdev.c > @@ -956,7 +956,7 @@ int dvb_usercopy(struct file *file, > int (*func)(struct file *file, > unsigned int cmd, void *arg)) > { > - char sbuf[128]; > + char sbuf[128] =3D {}; > void *mbuf =3D NULL; > void *parg =3D NULL; > int err =3D -EINVAL; > diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/stagin= g/media/tegra-video/tegra20.c > index c39b52d0e4447..630e2ff987a37 100644 > --- a/drivers/staging/media/tegra-video/tegra20.c > +++ b/drivers/staging/media/tegra-video/tegra20.c > @@ -164,6 +164,7 @@ static void tegra20_vi_get_input_formats(struct tegra= _vi_channel *chan, > unsigned int input_mbus_code =3D chan->fmtinfo->code; > =20 > (*main_input_format) =3D VI_INPUT_INPUT_FORMAT_YUV422; > + (*yuv_input_format) =3D VI_INPUT_YUV_INPUT_FORMAT_UYVY; I agree with Thierry this seems to be the best fix, making this function similar to tegra20_vi_get_output_formats(). However in this v2 your change ended up in patch 3 while it should be in patch 1. I'm glad to add my Reviewed-by tag on a new version with this fixed. Luca --=20 Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com