]> git.itanic.dy.fi Git - linux-stable/commit
platform/mellanox: mlxbf-pmc: fix sscanf() error checking
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 15 May 2023 10:32:37 +0000 (13:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:27 +0000 (14:17 +0100)
commit962deda98110f4a9cd9c3509d8a5d06cffb597be
treeddf6df3f6562b7bde854755057b2954e61caf85a
parent83b36e9d29e7a5d2a0d6cda5fff2ed7c1d9539ec
platform/mellanox: mlxbf-pmc: fix sscanf() error checking

commit 95e4b25192e9238fd2dbe85d96dd2f8fd1ce9d14 upstream.

The sscanf() function never returns negatives.  It returns the number of
items successfully read.

Fixes: 1a218d312e65 ("platform/mellanox: mlxbf-pmc: Add Mellanox BlueField PMC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/4ccdfd28-099b-40bf-8d77-ad4ea2e76b93@kili.mountain
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/mellanox/mlxbf-pmc.c