Messages in this thread Patch in this message | | | Date | Sat, 26 Jun 2004 19:08:35 -0700 | From | Andrew Morton <> | Subject | Re: [BUG 2.6.7-mm1] sysfs - possible bug |
| |
Luca Risolia <luca.risolia@studio.unibo.it> wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > This code causes some problems: > > static ssize_t sn9c102_show_i2c_val(struct class_device* cd, char* buf) > { > return -EIO; > } > static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, sn9c102_show_i2c_val, sn9c102_store_i2c_val);
Indeed it does.
> kernel BUG at fs/sysfs/file.c:93!
BUG_ON(count > PAGE_SIZE);
isn't right, because PAGE_SIZE is unsigned.
I'll send the below fix to Linus.
--- 25/fs/sysfs/file.c~sysfs-fill_read_buffer-fix 2004-06-26 19:03:11.821870464 -0700 +++ 25-akpm/fs/sysfs/file.c 2004-06-26 19:03:20.119609016 -0700 @@ -83,7 +83,7 @@ static int fill_read_buffer(struct file return -ENOMEM; count = ops->show(kobj,attr,buffer->page); - BUG_ON(count > PAGE_SIZE); + BUG_ON(count > (ssize_t)PAGE_SIZE); if (count >= 0) buffer->count = count; else _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |