diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 13 | ||||
-rw-r--r-- | drivers/char/random.c | 19 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 4 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_bios.c | 3 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 6 |
5 files changed, 29 insertions, 16 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index aa83a0865ec1..09050797c76a 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -2856,6 +2856,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
2856 | /* Assume a single IPMB channel at zero. */ | 2856 | /* Assume a single IPMB channel at zero. */ |
2857 | intf->channels[0].medium = IPMI_CHANNEL_MEDIUM_IPMB; | 2857 | intf->channels[0].medium = IPMI_CHANNEL_MEDIUM_IPMB; |
2858 | intf->channels[0].protocol = IPMI_CHANNEL_PROTOCOL_IPMB; | 2858 | intf->channels[0].protocol = IPMI_CHANNEL_PROTOCOL_IPMB; |
2859 | intf->curr_channel = IPMI_MAX_CHANNELS; | ||
2859 | } | 2860 | } |
2860 | 2861 | ||
2861 | if (rv == 0) | 2862 | if (rv == 0) |
@@ -3648,13 +3649,13 @@ static int handle_new_recv_msg(ipmi_smi_t intf, | |||
3648 | } | 3649 | } |
3649 | 3650 | ||
3650 | /* | 3651 | /* |
3651 | ** We need to make sure the channels have been initialized. | 3652 | * We need to make sure the channels have been initialized. |
3652 | ** The channel_handler routine will set the "curr_channel" | 3653 | * The channel_handler routine will set the "curr_channel" |
3653 | ** equal to or greater than IPMI_MAX_CHANNELS when all the | 3654 | * equal to or greater than IPMI_MAX_CHANNELS when all the |
3654 | ** channels for this interface have been initialized. | 3655 | * channels for this interface have been initialized. |
3655 | */ | 3656 | */ |
3656 | if (intf->curr_channel < IPMI_MAX_CHANNELS) { | 3657 | if (intf->curr_channel < IPMI_MAX_CHANNELS) { |
3657 | requeue = 1; /* Just put the message back for now */ | 3658 | requeue = 0; /* Throw the message away */ |
3658 | goto out; | 3659 | goto out; |
3659 | } | 3660 | } |
3660 | 3661 | ||
diff --git a/drivers/char/random.c b/drivers/char/random.c index f824ef8a9273..8c7444857a4b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1665,15 +1665,20 @@ EXPORT_SYMBOL(secure_dccp_sequence_number); | |||
1665 | * value is not cryptographically secure but for several uses the cost of | 1665 | * value is not cryptographically secure but for several uses the cost of |
1666 | * depleting entropy is too high | 1666 | * depleting entropy is too high |
1667 | */ | 1667 | */ |
1668 | DEFINE_PER_CPU(__u32 [4], get_random_int_hash); | ||
1668 | unsigned int get_random_int(void) | 1669 | unsigned int get_random_int(void) |
1669 | { | 1670 | { |
1670 | /* | 1671 | struct keydata *keyptr; |
1671 | * Use IP's RNG. It suits our purpose perfectly: it re-keys itself | 1672 | __u32 *hash = get_cpu_var(get_random_int_hash); |
1672 | * every second, from the entropy pool (and thus creates a limited | 1673 | int ret; |
1673 | * drain on it), and uses halfMD4Transform within the second. We | 1674 | |
1674 | * also mix it with jiffies and the PID: | 1675 | keyptr = get_keyptr(); |
1675 | */ | 1676 | hash[0] += current->pid + jiffies + get_cycles(); |
1676 | return secure_ip_id((__force __be32)(current->pid + jiffies)); | 1677 | |
1678 | ret = half_md4_transform(hash, keyptr->secret); | ||
1679 | put_cpu_var(get_random_int_hash); | ||
1680 | |||
1681 | return ret; | ||
1677 | } | 1682 | } |
1678 | 1683 | ||
1679 | /* | 1684 | /* |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index b0a6a3e51924..d6a807f4077d 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -406,7 +406,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
406 | &sysrq_showlocks_op, /* d */ | 406 | &sysrq_showlocks_op, /* d */ |
407 | &sysrq_term_op, /* e */ | 407 | &sysrq_term_op, /* e */ |
408 | &sysrq_moom_op, /* f */ | 408 | &sysrq_moom_op, /* f */ |
409 | /* g: May be registered by ppc for kgdb */ | 409 | /* g: May be registered for the kernel debugger */ |
410 | NULL, /* g */ | 410 | NULL, /* g */ |
411 | NULL, /* h - reserved for help */ | 411 | NULL, /* h - reserved for help */ |
412 | &sysrq_kill_op, /* i */ | 412 | &sysrq_kill_op, /* i */ |
@@ -431,7 +431,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
431 | &sysrq_sync_op, /* s */ | 431 | &sysrq_sync_op, /* s */ |
432 | &sysrq_showstate_op, /* t */ | 432 | &sysrq_showstate_op, /* t */ |
433 | &sysrq_mountro_op, /* u */ | 433 | &sysrq_mountro_op, /* u */ |
434 | /* v: May be registered at init time by SMP VOYAGER */ | 434 | /* v: May be registered for frame buffer console restore */ |
435 | NULL, /* v */ | 435 | NULL, /* v */ |
436 | &sysrq_showstate_blocked_op, /* w */ | 436 | &sysrq_showstate_blocked_op, /* w */ |
437 | /* x: May be registered on ppc/powerpc for xmon */ | 437 | /* x: May be registered on ppc/powerpc for xmon */ |
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index ed306eb1057f..0c2f55a38b95 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -212,7 +212,8 @@ static int get_event_name(char *dest, struct tcpa_event *event, | |||
212 | unsigned char * event_entry) | 212 | unsigned char * event_entry) |
213 | { | 213 | { |
214 | const char *name = ""; | 214 | const char *name = ""; |
215 | char data[40] = ""; | 215 | /* 41 so there is room for 40 data and 1 nul */ |
216 | char data[41] = ""; | ||
216 | int i, n_len = 0, d_len = 0; | 217 | int i, n_len = 0, d_len = 0; |
217 | struct tcpa_pc_event *pc_event; | 218 | struct tcpa_pc_event *pc_event; |
218 | 219 | ||
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index a2dee0eb6dad..e6ce632a393e 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -400,6 +400,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
400 | case KIOCSOUND: | 400 | case KIOCSOUND: |
401 | if (!perm) | 401 | if (!perm) |
402 | goto eperm; | 402 | goto eperm; |
403 | /* FIXME: This is an old broken API but we need to keep it | ||
404 | supported and somehow separate the historic advertised | ||
405 | tick rate from any real one */ | ||
403 | if (arg) | 406 | if (arg) |
404 | arg = CLOCK_TICK_RATE / arg; | 407 | arg = CLOCK_TICK_RATE / arg; |
405 | kd_mksound(arg, 0); | 408 | kd_mksound(arg, 0); |
@@ -417,6 +420,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
417 | */ | 420 | */ |
418 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; | 421 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; |
419 | count = ticks ? (arg & 0xffff) : 0; | 422 | count = ticks ? (arg & 0xffff) : 0; |
423 | /* FIXME: This is an old broken API but we need to keep it | ||
424 | supported and somehow separate the historic advertised | ||
425 | tick rate from any real one */ | ||
420 | if (count) | 426 | if (count) |
421 | count = CLOCK_TICK_RATE / count; | 427 | count = CLOCK_TICK_RATE / count; |
422 | kd_mksound(count, ticks); | 428 | kd_mksound(count, ticks); |