[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y8p/Zh22evztnaEj@smile.fi.intel.com>
Date: Fri, 20 Jan 2023 13:47:50 +0200
From: 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>
To: David Laight <David.Laight@...lab.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 2/9] pktcdvd: replace sscanf() by kstrtoul()
On Thu, Jan 19, 2023 at 10:40:12PM +0000, David Laight wrote:
> From: Andy Shevchenko
> > Sent: 19 January 2023 22:08
...
> > + ret = kstrtoint(buf, 10, &val);
> > + if (ret)
> > + return ret;
> These don't look directly equivalent.
> The sscanf() version silently ignores trailing characters.
> I think kstrtoint() will generate an error.
Yes, kstrtoint() is stricter than sscanf(), but I believe
that user space not so abusive. We may always return to
sscanf(), which I don't think would be good idea rather
than fixing the user space. But let's see...
> Have you actually checked that the caller allows for
> an error return.
_s_size_t somehow hints us about :-)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists