From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796192494; b=N2PHKJpzYW+k77e6gSOXQIisNpknXXysbc3hlfVF7F9deNrK3lhvAy4hM6QZBG/BdZqA Of1RoQ0cVv9L4b8Bsl3idI6MzQrbCOMqXVZxWfpC9HSuVpP1oVHRDD9Pmq16O8xF6Qxu8 SNBdvaqCcICZ2SANHeigV3HiULljAkdLWUsuawqgW0hIcAqkHPkvu8l9VB1/+6lLS//Z2 Pq5HjGcfkGobcH8jMK9cNU+sdmGFON7M442VtD5qLQRkd9QYZGQOAZdSyzO/EoiS3Nvmh lxR1wpOuFWiitX1Y2FgOq1Rvx0kTfc98ga8t59Iri96sIIC9XNVtvfQHwvC1GWJ6Gqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796192494; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=nOc7uDGu2U7odhKph8arfqLUNZh86nws5ITU4FX/NMM=; b=OMm333vsjIMw22I+KrjzF92Zt07thjM8MLUXqtdpZVOYNQiYvGB1AP8r+EvHG75lo0+m 3rbJYuQPuZ7yucQDRqxKV6EzTY1YKlEgLz5J28DuVyMNEc3M2HtI7Lbs0d6U9gZLIScxT humXtKcN4M1p3wVnD2X5Bjv2a6s95BZCMjzWLizy0NSuNoIDfKWOvUqLOulTpaGFbzUAC YNrGGZ5bXa58L5r2/oA4tfThiDX5suG7RX4hUU2fMRQnQRY14+9kvDHvWHsbwMCg2F9D7 YT3s615U7qBBa0g0ZrN/QGij/1bXr6auMWcmF23XFVSqGm/A8LyK9ZtdFKM2wskpNCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BvE1jYUW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 772CD606A31A; Wed, 2 Dec 2026 06:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BvE1jYUW Received: by smtp.kernel.org (Postfix) with ESMTPSA id C14801F00897; Wed, 2 Dec 2026 06:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796192494; bh=nOc7uDGu2U7odhKph8arfqLUNZh86nws5ITU4FX/NMM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=BvE1jYUW/S++WI85XS54hfuaVWcEgeOzOlgluP3CLS3m5h0z+v87SkPHZm0sdh0D2 oooirfQ/tevmGS2UcCZ1fDiVfhbn4coHHlrylxQjH1XXJAqNwdhqRaYdf1yEOtIUB0 035YAXKfpqFNY/qWCPh2Psc7f8DJ/Hult5Ln0OhEWUQ+nyh0HTSFI8AJxZ1jkPpfr0 bPhsHNcuJMeaNan+NHD9SisbA42cl2SEjeUjEMh/FmyXf0EbQ9WhjRVAxQ82y2PExs SnqIHqoYg12dw6PmjaRIU4SEDU9+ahknv8P1h4ug36swMOyvKpHugoM04D6n1f6BU0 eSLszo+F1F94A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 3/7] Input: novatek-nvt-ts - add SPI bus support Reply-To: sashiko-reviews@lists.linux.dev To: "Qianhui Xu" Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261202061414.548247-3-xiaqinghuan@mail.ustc.edu.cn> References: <20261202061414.548247-1-xiaqinghuan@mail.ustc.edu.cn> <20261202061414.548247-3-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 06:21:33 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] Input: novatek-nvt-ts - open-coded kzalloc() and kfree() in nvt_ts_spi_read() -- commit 5f4104996cb50a4abaced3ceff54734af0768c3b Author: Qianhui Xu Input: novatek-nvt-ts - add SPI bus support This commit adds an SPI driver for Novatek NVT touchscreen controllers and builds the shared core as a separate Kconfig symbol. > diff --git a/drivers/input/touchscreen/novatek-nvt-ts-spi.c b/drivers/inp= ut/touchscreen/novatek-nvt-ts-spi.c > new file mode 100644 > index 0000000000000..8840e764623d3 > --- /dev/null > +++ b/drivers/input/touchscreen/novatek-nvt-ts-spi.c > @@ -0,0 +1,103 @@ [ ... ] > +static int nvt_ts_spi_read(struct nvt_ts_data *data, u8 reg, u8 *buf, > + size_t count) > +{ > + struct spi_device *spi =3D to_spi_device(data->dev); > + struct spi_transfer xfer =3D { }; > + u8 *tx, *rx; > + int error; > + > + /* > + * The read has to be one full-duplex transfer: the address byte and one > + * dummy byte go out while the payload comes in. Split into a write and > + * a read transfer the controller hands back the bytes it was sent > + * instead of the payload. > + * > + * Both buffers are mapped for DMA as is, so neither the caller's buffer > + * nor a stack buffer can be used. > + */ > + tx =3D kmalloc(count + 2, GFP_KERNEL); > + rx =3D kmalloc(count + 2, GFP_KERNEL); > + if (!tx || !rx) { > + error =3D -ENOMEM; > + goto out; > + } > + > + memset(tx, 0, count + 2); > + tx[0] =3D reg & 0x7f; > + xfer.tx_buf =3D tx; > + xfer.rx_buf =3D rx; > + xfer.len =3D count + 2; > + > + error =3D spi_sync_transfer(spi, &xfer, 1); > + if (!error) > + memcpy(buf, rx + 2, count); > +out: > + kfree(rx); > + kfree(tx); > + > + return error; > +} [Severity: Low] This isn't a bug, but could tx and rx use __free(kfree), with tx allocated via kzalloc() instead of kmalloc() followed by memset()? That would drop the manual memset() and the out label. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202061414.5482= 47-1-xiaqinghuan@mail.ustc.edu.cn?part=3D3