Re: [PATCH v5] staging: unisys: move parahotplug to sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux