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=1796172276; b=iCcpLTJwkJolVN1YiO7Iic4FsXhozfml02XmYnvCWyw/TkKTfyH41esipiD2NrblsBI5 PDUPYxgvp3+rKzl7jQMd8e0LcIp3XOuXAVRZ4BABQEPDstgTYGn1LGWdkBF++BpsL7EqY /pFtS8VztYiZ31z0iGsWbqdQlz83fzGMmfQq2ps4UFv/lHRRqiFNMKoD8xBDPVFB3pGYC MuKH2jXcoaU4bVqmNW7wHl4B2zlYKzENDIXHy/1xM8+5xD9B5Ds+woYdiFlJzZsP+6W6J M5BtSnf50cgVWhXyQiwQI6JH47j75K+2Eq1wrms25mi/uaP/MJ6PzEGt4w5Cu3Rm6aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796172276; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=wkzg62HfSgowOyM6W4WxQS3M34vdToMcMBrvbWMiyuE=; b=zcvMu1/ZnXQKB5/7EM2Oe2eXCYEYEXPO1/xYvBE6LhIHqptf2lQl2YvKE8vfI5AesOr7 p6WAjKqCPwtSWfFUphnXM4wd29yNNfzozNmADn37SYSucTJ6TtV+9kE65Mq84eHa80CKs B3ecSBd9vnZMGz08WDlcMAxfjk+UUFOf85nGDcuwwpQylfs02OmskoUQrdvBV3dYuyLYA f1UXPX5GYaqrEBg/sTwK4Qofh4B5GJHSCVV8e/CLBuRIu71Oi1DCc8VhrHtUN0sRB50A3 Fs9yv9Hlq8xtfIxXEbR5lKNvd+FkSG+WAAlVw1CvrHP84zCQG7NmnmOEyt+XEbN750w== 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=PFqHYxUE; 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 5FCA5606A31A; Wed, 2 Dec 2026 00:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PFqHYxUE Received: by smtp.kernel.org (Postfix) with ESMTPSA id B91781F00893; Wed, 2 Dec 2026 00:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796172275; bh=wkzg62HfSgowOyM6W4WxQS3M34vdToMcMBrvbWMiyuE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=PFqHYxUEbTrPbYdtiGocpeH+E0hN3UFQjPPV2qOWDzZQc9OP7QEM9hamhbs/OBV1N mmrLJEJz2c5Y6eMzmVl0zGRxrvyL/OQFxYyjNlU3+jEudiifPLeAU4wLx+9rY7zgOY U1cwkM6PqbfR2glxlWtDRttT6G4YYanRlILflnXXd7YN6x/VuC8F9supjYlxsN7oM4 1Bgai+wN+cUZ9k8r7SS5D5Ws8pvwSExmeJz7U5qB8s8pOSaaf3Wl4IzxYRSRRQ9Rox SEZtzZMcFirHZUx6wJT5k/cTs5s7WLwRPSXNGDRZvBDA3Vg44My08TbEYUaC1cXFOr 0hVrJXgGUE9CQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 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: <20261202003159.1321846-3-xiaqinghuan@mail.ustc.edu.cn> References: <20261202003159.1321846-1-xiaqinghuan@mail.ustc.edu.cn> <20261202003159.1321846-3-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 00:44:35 +0000 X-Mailing-List: devicetree@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 2 potential issues to consider: - [High] Input: novatek-nvt-ts: NULL deref in suspend/resume due to unset drvdata - [Medium] Input: novatek-nvt-ts: broken ID-table match data lookup in nvt_ts_probe() -- commit 65e783365c06ee1cad22c37ad9595fc2e94f4d65 Author: Qianhui Xu Input: novatek-nvt-ts - add SPI bus support This commit builds the Novatek NVT touchscreen core as a separate module and adds an SPI bus driver sharing that core. > 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..42c02f99f50cd > --- /dev/null > +++ b/drivers/input/touchscreen/novatek-nvt-ts-spi.c > @@ -0,0 +1,71 @@ [ ... ] > +static int nvt_ts_spi_probe(struct spi_device *spi) > +{ > + return nvt_ts_probe(&spi->dev, &nvt_ts_spi_bus_ops, spi->irq, BUS_SPI, > + dev_name(&spi->dev)); > +} > + > +static const struct of_device_id nvt_ts_spi_of_match[] =3D { > + { .compatible =3D "novatek,nt11205-ts", .data =3D &nvt_nt11205_ts_data = }, > + { .compatible =3D "novatek,nt36672a-ts", .data =3D &nvt_nt36672a_ts_dat= a }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, nvt_ts_spi_of_match); > + > +static const struct spi_device_id nvt_ts_spi_id[] =3D { > + { .name =3D "nt11205-ts", .driver_data =3D (unsigned long)&nvt_nt11205_= ts_data }, > + { .name =3D "nt36672a-ts", .driver_data =3D (unsigned long)&nvt_nt36672= a_ts_data }, > + { } > +}; > +MODULE_DEVICE_TABLE(spi, nvt_ts_spi_id); [Severity: Medium] Will devices matched through nvt_ts_spi_id fail to probe with -EINVAL? nvt_ts_probe() looks up the chip data with device_get_match_data(dev), which only queries OF and ACPI fwnode match tables and returns NULL for spi_device_id matches (unlike spi_get_device_match_data()). > + > +static DEFINE_SIMPLE_DEV_PM_OPS(nvt_ts_spi_pm_ops, nvt_ts_suspend, nvt_t= s_resume); [Severity: High] Does system suspend or resume trigger a NULL pointer dereference in nvt_ts_suspend() and nvt_ts_resume()? drivers/input/touchscreen/novatek-nvt-ts-core.c:nvt_ts_suspend() { struct nvt_ts_data *data =3D dev_get_drvdata(dev); guard(mutex)(&data->input->mutex); ... } nvt_ts_probe() calls input_set_drvdata(input, data), which sets driver_data on &input->dev, but never calls dev_set_drvdata(dev, data) on the bus device (&spi->dev). When the PM callbacks run for &spi->dev, dev_get_drvdata(dev) returns NULL and accessing data->input crashes. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202003159.1321= 846-1-xiaqinghuan@mail.ustc.edu.cn?part=3D3