[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzQ9+Wzhfnila1s3@orome>
Date: Wed, 28 Sep 2022 14:28:41 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Subject: Re: [PATCH v2 3/4] pwm: sysfs: Replace sprintf() with sysfs_emit()
On Fri, Aug 26, 2022 at 08:07:15PM +0300, Andy Shevchenko wrote:
> For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
> instead of the raw sprintf() & co. This patch replaces such a
> sprintf() call straightforwardly with the new helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> ---
> v2: added tag (Uwe)
> drivers/pwm/sysfs.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
How exactly is sysfs_emit() safer here? In all of these cases, the
values that sprintf() writes are the only values that are written into
the buffer and we know that none of them exceed PAGE_SIZE. So the
additional checks that sysfs_emit() performs are useless.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists