Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46891
b: refs/heads/master
c: 0524aad
h: refs/heads/master
i:
  46889: e7322f9
  46887: 50e04dd
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Feb 8, 2007
1 parent f971653 commit 4b9b75e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8b93a902315aeeedf51c45f01a407d5d8288c72
refs/heads/master: 0524aad7b89671bc788d483b2c048ac7b79eefb9
11 changes: 7 additions & 4 deletions trunk/arch/powerpc/kernel/lparcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,

ssize_t retval = -ENOMEM;

if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
firmware_has_feature(FW_FEATURE_ISERIES))
return -EINVAL;

kbuf = kmalloc(count, GFP_KERNEL);
if (!kbuf)
goto out;
Expand Down Expand Up @@ -517,7 +521,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
static ssize_t lparcfg_write(struct file *file, const char __user * buf,
size_t count, loff_t * off)
{
return count;
return -EINVAL;
}

#endif /* CONFIG_PPC_PSERIES */
Expand Down Expand Up @@ -570,6 +574,7 @@ static int lparcfg_open(struct inode *inode, struct file *file)
struct file_operations lparcfg_fops = {
.owner = THIS_MODULE,
.read = seq_read,
.write = lparcfg_write,
.open = lparcfg_open,
.release = single_release,
};
Expand All @@ -581,10 +586,8 @@ int __init lparcfg_init(void)

/* Allow writing if we have FW_FEATURE_SPLPAR */
if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
!firmware_has_feature(FW_FEATURE_ISERIES)) {
lparcfg_fops.write = lparcfg_write;
!firmware_has_feature(FW_FEATURE_ISERIES))
mode |= S_IWUSR;
}

ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
if (ent) {
Expand Down

0 comments on commit 4b9b75e

Please sign in to comment.