aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/ipmi/ipmi_bt_sm.c4
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c14
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c3
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c16
4 files changed, 26 insertions, 11 deletions
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index cdd4c09fda96..a22a7a502740 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -95,9 +95,9 @@ struct si_sm_data {
95 enum bt_states state; 95 enum bt_states state;
96 unsigned char seq; /* BT sequence number */ 96 unsigned char seq; /* BT sequence number */
97 struct si_sm_io *io; 97 struct si_sm_io *io;
98 unsigned char write_data[IPMI_MAX_MSG_LENGTH]; 98 unsigned char write_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */
99 int write_count; 99 int write_count;
100 unsigned char read_data[IPMI_MAX_MSG_LENGTH]; 100 unsigned char read_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */
101 int read_count; 101 int read_count;
102 int truncated; 102 int truncated;
103 long timeout; /* microseconds countdown */ 103 long timeout; /* microseconds countdown */
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 9eb360ff8cab..d5a5f020810a 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -837,13 +837,25 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
837 return ipmi_ioctl(filep, cmd, arg); 837 return ipmi_ioctl(filep, cmd, arg);
838 } 838 }
839} 839}
840
841static long unlocked_compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
842 unsigned long arg)
843{
844 int ret;
845
846 mutex_lock(&ipmi_mutex);
847 ret = compat_ipmi_ioctl(filep, cmd, arg);
848 mutex_unlock(&ipmi_mutex);
849
850 return ret;
851}
840#endif 852#endif
841 853
842static const struct file_operations ipmi_fops = { 854static const struct file_operations ipmi_fops = {
843 .owner = THIS_MODULE, 855 .owner = THIS_MODULE,
844 .unlocked_ioctl = ipmi_unlocked_ioctl, 856 .unlocked_ioctl = ipmi_unlocked_ioctl,
845#ifdef CONFIG_COMPAT 857#ifdef CONFIG_COMPAT
846 .compat_ioctl = compat_ipmi_ioctl, 858 .compat_ioctl = unlocked_compat_ipmi_ioctl,
847#endif 859#endif
848 .open = ipmi_open, 860 .open = ipmi_open,
849 .release = ipmi_release, 861 .release = ipmi_release,
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 4d439d2fcfd6..4445fa164a2d 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2037,12 +2037,11 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
2037 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 2037 entry = kmalloc(sizeof(*entry), GFP_KERNEL);
2038 if (!entry) 2038 if (!entry)
2039 return -ENOMEM; 2039 return -ENOMEM;
2040 entry->name = kmalloc(strlen(name)+1, GFP_KERNEL); 2040 entry->name = kstrdup(name, GFP_KERNEL);
2041 if (!entry->name) { 2041 if (!entry->name) {
2042 kfree(entry); 2042 kfree(entry);
2043 return -ENOMEM; 2043 return -ENOMEM;
2044 } 2044 }
2045 strcpy(entry->name, name);
2046 2045
2047 file = proc_create_data(name, 0, smi->proc_dir, proc_ops, data); 2046 file = proc_create_data(name, 0, smi->proc_dir, proc_ops, data);
2048 if (!file) { 2047 if (!file) {
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 313538abe63c..af4b23ffc5a6 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -663,8 +663,10 @@ static void handle_transaction_done(struct smi_info *smi_info)
663 /* We got the flags from the SMI, now handle them. */ 663 /* We got the flags from the SMI, now handle them. */
664 smi_info->handlers->get_result(smi_info->si_sm, msg, 4); 664 smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
665 if (msg[2] != 0) { 665 if (msg[2] != 0) {
666 dev_warn(smi_info->dev, "Could not enable interrupts" 666 dev_warn(smi_info->dev,
667 ", failed get, using polled mode.\n"); 667 "Couldn't get irq info: %x.\n", msg[2]);
668 dev_warn(smi_info->dev,
669 "Maybe ok, but ipmi might run very slowly.\n");
668 smi_info->si_state = SI_NORMAL; 670 smi_info->si_state = SI_NORMAL;
669 } else { 671 } else {
670 msg[0] = (IPMI_NETFN_APP_REQUEST << 2); 672 msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
@@ -685,10 +687,12 @@ static void handle_transaction_done(struct smi_info *smi_info)
685 687
686 /* We got the flags from the SMI, now handle them. */ 688 /* We got the flags from the SMI, now handle them. */
687 smi_info->handlers->get_result(smi_info->si_sm, msg, 4); 689 smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
688 if (msg[2] != 0) 690 if (msg[2] != 0) {
689 dev_warn(smi_info->dev, "Could not enable interrupts" 691 dev_warn(smi_info->dev,
690 ", failed set, using polled mode.\n"); 692 "Couldn't set irq info: %x.\n", msg[2]);
691 else 693 dev_warn(smi_info->dev,
694 "Maybe ok, but ipmi might run very slowly.\n");
695 } else
692 smi_info->interrupt_disabled = 0; 696 smi_info->interrupt_disabled = 0;
693 smi_info->si_state = SI_NORMAL; 697 smi_info->si_state = SI_NORMAL;
694 break; 698 break;