static ssize_t validate_flash_write(struct file *file, const char *buf, 
static ssize_t validate_flash_write(struct file *file, const char __user *buf, 
static ssize_t validate_flash_write(struct file *file, const char *buf,				    size_t count, loff_t *off){	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);	struct rtas_validate_flash_t *args_buf;	int rc;	args_buf = (struct rtas_validate_flash_t *) dp->data;	if (dp->data == NULL) {		dp->data = kmalloc(sizeof(struct rtas_validate_flash_t), 				GFP_KERNEL);		if (dp->data == NULL) 			return -ENOMEM;	}	/* We are only interested in the first 4K of the	 * candidate image */	if ((*off >= VALIDATE_BUF_SIZE) || 		(args_buf->status == VALIDATE_AUTH)) {		*off += count;		return count;	}	if (*off + count >= VALIDATE_BUF_SIZE)  {		count = VALIDATE_BUF_SIZE - *off;		args_buf->status = VALIDATE_READY;		} else {		args_buf->status = VALIDATE_INCOMPLETE;	}	if (!access_ok(VERIFY_READ, buf, count)) {		rc = -EFAULT;		goto done;	}	if (copy_from_user(args_buf->buf + *off, buf, count)) {		rc = -EFAULT;		goto done;	}	*off += count;	rc = count;done:	if (rc < 0) {		kfree(dp->data);		dp->data = NULL;	}	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/efa545791ff439d778f79d02255d59ff1f7ea0fc/rtas_flash.c/buggy/arch/ppc64/kernel/rtas_flash.c