diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/ds.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/prom_common.c | 4 | ||||
-rw-r--r-- | arch/sparc/mm/btfixup.c | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 7429b47c3aca..381edcd5bc29 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev, | |||
1181 | 1181 | ||
1182 | dp->rcv_buf_len = 4096; | 1182 | dp->rcv_buf_len = 4096; |
1183 | 1183 | ||
1184 | dp->ds_states = kzalloc(sizeof(ds_states_template), | 1184 | dp->ds_states = kmemdup(ds_states_template, |
1185 | GFP_KERNEL); | 1185 | sizeof(ds_states_template), GFP_KERNEL); |
1186 | if (!dp->ds_states) | 1186 | if (!dp->ds_states) |
1187 | goto out_free_rcv_buf; | 1187 | goto out_free_rcv_buf; |
1188 | 1188 | ||
1189 | memcpy(dp->ds_states, ds_states_template, | ||
1190 | sizeof(ds_states_template)); | ||
1191 | dp->num_ds_states = ARRAY_SIZE(ds_states_template); | 1189 | dp->num_ds_states = ARRAY_SIZE(ds_states_template); |
1192 | 1190 | ||
1193 | for (i = 0; i < dp->num_ds_states; i++) | 1191 | for (i = 0; i < dp->num_ds_states; i++) |
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c index 46614807a57f..741df916c124 100644 --- a/arch/sparc/kernel/prom_common.c +++ b/arch/sparc/kernel/prom_common.c | |||
@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len | |||
58 | void *new_val; | 58 | void *new_val; |
59 | int err; | 59 | int err; |
60 | 60 | ||
61 | new_val = kmalloc(len, GFP_KERNEL); | 61 | new_val = kmemdup(val, len, GFP_KERNEL); |
62 | if (!new_val) | 62 | if (!new_val) |
63 | return -ENOMEM; | 63 | return -ENOMEM; |
64 | 64 | ||
65 | memcpy(new_val, val, len); | ||
66 | |||
67 | err = -ENODEV; | 65 | err = -ENODEV; |
68 | 66 | ||
69 | mutex_lock(&of_set_property_mutex); | 67 | mutex_lock(&of_set_property_mutex); |
diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c index 5175ac2f4820..8a7f81743c12 100644 --- a/arch/sparc/mm/btfixup.c +++ b/arch/sparc/mm/btfixup.c | |||
@@ -302,8 +302,7 @@ void __init btfixup(void) | |||
302 | case 'i': /* INT */ | 302 | case 'i': /* INT */ |
303 | if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ | 303 | if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ |
304 | set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); | 304 | set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); |
305 | else if ((insn & 0x80002000) == 0x80002000 && | 305 | else if ((insn & 0x80002000) == 0x80002000) /* %LO */ |
306 | (insn & 0x01800000) != 0x01800000) /* %LO */ | ||
307 | set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); | 306 | set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); |
308 | else { | 307 | else { |
309 | prom_printf(insn_i, p, addr, insn); | 308 | prom_printf(insn_i, p, addr, insn); |