#! /bin/sh -e ## .dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: Fixed signedness problem in sysfs. ## DP: Patch author: Alexander Nyberg ## DP: Upstream status: backport . $(dirname $0)/DPATCH @DPATCH@ diff -urN x/fs/sysfs/file.c y/fs/sysfs/file.c --- x/fs/sysfs/file.c 2004-08-24 17:15:28.000000000 +1000 +++ y/fs/sysfs/file.c 2005-04-05 19:54:31.000000000 +1000 @@ -228,13 +228,14 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct sysfs_buffer * buffer = file->private_data; + ssize_t len; - count = fill_write_buffer(buffer,buf,count); - if (count > 0) - count = flush_write_buffer(file,buffer,count); - if (count > 0) - *ppos += count; - return count; + len = fill_write_buffer(buffer, buf, count); + if (len > 0) + len = flush_write_buffer(file, buffer, len); + if (len > 0) + *ppos += len; + return len; } static int check_perm(struct inode * inode, struct file * file)