diff options
Diffstat (limited to 'arch/sparc/kernel/ds.c')
| -rw-r--r-- | arch/sparc/kernel/ds.c | 21 | 
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 5ef48dab5636..62d6b153ffa2 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -528,10 +528,8 @@ static void dr_cpu_mark(struct ds_data *resp, int cpu, int ncpus,  	}  } -static int __cpuinit dr_cpu_configure(struct ds_info *dp, -				      struct ds_cap_state *cp, -				      u64 req_num, -				      cpumask_t *mask) +static int dr_cpu_configure(struct ds_info *dp, struct ds_cap_state *cp, +			    u64 req_num, cpumask_t *mask)  {  	struct ds_data *resp;  	int resp_len, ncpus, cpu; @@ -627,9 +625,8 @@ static int dr_cpu_unconfigure(struct ds_info *dp,  	return 0;  } -static void __cpuinit dr_cpu_data(struct ds_info *dp, -				  struct ds_cap_state *cp, -				  void *buf, int len) +static void dr_cpu_data(struct ds_info *dp, struct ds_cap_state *cp, void *buf, +			int len)  {  	struct ds_data *data = buf;  	struct dr_cpu_tag *tag = (struct dr_cpu_tag *) (data + 1); @@ -783,6 +780,16 @@ void ldom_set_var(const char *var, const char *value)  		char  *base, *p;  		int msg_len, loops; +		if (strlen(var) + strlen(value) + 2 > +		    sizeof(pkt) - sizeof(pkt.header)) { +			printk(KERN_ERR PFX +				"contents length: %zu, which more than max: %lu," +				"so could not set (%s) variable to (%s).\n", +				strlen(var) + strlen(value) + 2, +				sizeof(pkt) - sizeof(pkt.header), var, value); +			return; +		} +  		memset(&pkt, 0, sizeof(pkt));  		pkt.header.data.tag.type = DS_DATA;  		pkt.header.data.handle = cp->handle;  | 
