Message ID | d357fca843f8d3cc36a048732585de24d379a292.1698081019.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers | show |
Series | ACPI: sysfs: Fix some issues in create_of_modalias() and create_pnp_modalias() | expand |
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 7ec3142f3eda..1cf6568a813f 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -177,7 +177,7 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia len += count; size -= count; } - modalias[len] = '\0'; + return len; } @@ -237,7 +237,7 @@ static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias len += count; size -= count; } - modalias[len] = '\0'; + return len; }
'modalias' is only written with snprintf(), so it is already guaranteed to be NULL terminated. Remove the unneeded (but harmless) writes of a trailing '\0'. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/acpi/device_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)