On 10/14/25 1:02 PM, Jonas Rebmann wrote:
> TLV parsing happens in the TLV drivers probe function
> (tlv_probe_from_magic()) but register_device() does not propagate
> errors from match(), always returning zero.
> 
> match() however ensures that dev->driver is always NULL if an error
> occurred on probe and since we're only probing the TLV driver, rely on
> that as indicator of an error during TLV parsing (e.g. CRC mismatch).
> 
> Signed-off-by: Jonas Rebmann <[email protected]>

Reviewed-by: Ahmad Fatoum <[email protected]>

> ---
>  commands/tlv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/commands/tlv.c b/commands/tlv.c
> index 6118a2947f..c01a7b0399 100644
> --- a/commands/tlv.c
> +++ b/commands/tlv.c
> @@ -29,7 +29,7 @@ static int do_tlv(int argc, char *argv[])
>               return COMMAND_ERROR_USAGE;
>  
>       tlvdev = tlv_register_device_by_path(filename, NULL);
> -     if (IS_ERR(tlvdev)) {
> +     if (IS_ERR(tlvdev) || tlvdev->dev.driver == NULL) {
>               printf("Could not open \"%s\": %m\n", filename);
>               return COMMAND_ERROR;
>       }
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |


Reply via email to