Skip to contentSkip to conversation

media: tda18250: Use %*ph to print small buffer

PATCH In review Andy Shevchenko 2 participants 3 messages Jun 3 – Jun 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: tda18250: Use %*ph to print small buffer

Use %*ph format to print small buffer as hex string.

---
 drivers/media/tuners/tda18250.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/tuners/tda18250.c +1 -2
index 7bb945ba0989..9dbb5ea3b487 100644
@@ -804,8 +804,7 @@ static int tda18250_probe(struct i2c_client *client)
 
 	/* read the three chip ID registers */
 	regmap_bulk_read(dev->regmap, R00_ID1, &chip_id, 3);
-	dev_dbg(&client->dev, "chip_id=%02x:%02x:%02x",
-			chip_id[0], chip_id[1], chip_id[2]);
+	dev_dbg(&client->dev, "chip_id=%3phC", chip_id);
 
 	switch (chip_id[0]) {
 	case 0xc7:
Signature · 1 line
2.50.1
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but an unconditional dereference of client->dev.platform_data can cause a kernel Oops. --

commit 1ea3356f8c26d9844c17f495f65f794b5140a6ef
Author: Andy Shevchenko <[email protected]>

media: tda18250: Use %*ph to print small buffer

This commit updates the driver to use the %*ph format specifier for printing a small buffer as a hex string.

drivers/media/tuners/tda18250.c static int tda18250_probe(struct i2c_client *client)

Quoted 4 lines
drivers/media/tuners/tda18250.c +0 -0
@@ -804,8 +804,7 @@ static int tda18250_probe(struct i2c_client *client)

[Severity: High]
This is a pre-existing issue, but can an unconditional dereference of client->dev.platform_data cause a kernel oops?

In tda18250_probe(), cfg is initialized from platform_data and immediately dereferenced without a prior null check:

static int tda18250_probe(struct i2c_client *client)

{
        struct tda18250_config *cfg = client->dev.platform_data;
        struct dvb_frontend *fe = cfg->fe;

If the device is instantiated without platform data, such as when a root user manually creates the device via the i2c new_device sysfs interface or if bound via an incomplete device tree node, cfg will be null.

Does reading the fe member from a null cfg pointer result in a concrete null pointer dereference bringing the system down?

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
Quoted 4 lines · On Wed, Jun 03, 2026 at 11:35:37AM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:

^^^ Exactly, but thanks!

To the maintainers, I'm not going to address this report even if it's valid.

Quoted 2 lines

- [High] This problem wasn't introduced by this patch, but an unconditional dereference of client->dev.platform_data can cause a kernel Oops.

Signature · 2 lines
With Best Regards,
Andy Shevchenko