[PATCH v5] staging: unisys: move parahotplug to sysfs
Dan Carpenter
dan.carpenter at oracle.com
Tue Jul 29 13:58:37 UTC 2014
On Tue, Jul 29, 2014 at 08:15:38AM -0500, Romer, Benjamin M wrote:
> On Tue, 2014-07-29 at 12:13 +0300, Dan Carpenter wrote:
>
> > This is the same bug I mentioned ealier in a different patch.
>
> Yes, I know that - my intent was to get this patch in to move the entry,
> then fix the error in the function, like how the other sysfs functions
> got fixed. The code in this patches' sysfs functions is a cut and paste
> of what was in parahotplug_proc_write() with small modifications so that
> it will build.
>
> I'll split this into a patch that deletes the proc entry, and a separate
> patch that adds the sysfs entries with corrected code, then. Hopefully I
> won't get any complaints about that being too many logical changes.
We have a communication break down somewhere. The old code looks like
this:
- if (sscanf(buf, "%u %hu", &id, &active) != 2) {
This is working code. The new code looks like this:
+ if (kstrtouint(buf, 10, &id) != 1)
return -EINVAL;
This is broken code which clearly hasn't been tested. Wat???
I don't understand how that is ok?
regards,
dan carpenter
More information about the devel
mailing list