Small fixes for various things, been sitting in next for a

while (some a long time).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJacdBGAAoJEGHzjJCRm/+BNZsQAIW5bn2JbBWem0fh/w1LKDO5
 AZL6uEgQWkuU1Puh/AMjYaQcfqqVsBFqO6DWZSbvggHNG6Uh5wNYhQjj+bVPf64C
 UWf6/a+9AdvHMnkg6IWV+Sk/ceCNY4OK7BkJRYVQoMv9C0nzePlmm/BPN8vJ6QuM
 R0jc15esxikP0s0MvfxSCFaNvajKTYK300lrUJ5tBaSll8AUcSxHAt20tnUr5Jh1
 6VVWPUT/3jWnS+jDd0pbw/RK9Mdp1gwuWBMLsIs1ufn33GxrNonB7pvtJ48Mvk8p
 XxDbcg1jMaKnjFwvL+O0E4qJzYZpufZx7K3LERFVXZOLbm9//9o8BZWJ3Kyz9ZIY
 QAIOrGlJNTWZID9chckXoqPeJYW218s0uQa8RIzw6wwdfIcNL9hLl6GYd8I2LELW
 QhXQWrJ98yAr26by/Fs9SKi8HXC1JyCnU731V7ZM9b4D5YekxjJGVY8AmDyXRF0m
 xLkO/XiY0rmroT53fYfqz8q4W9TehOfKZXSLu5T+0OBvOiFFwDWnJ4NwRq20M32E
 JJay4O76KDIUh3HPU13E7Q3mmLNZ9MYYNBO2KT4jX81dYczO3Si4fV6GCeGAu4uA
 jWkqr+hjfFOm2dtNPXFpO7gYfjSzeNwMhp+Yg6yvQmaopNuGUfWiFt96YqPJEETn
 E+gTrzVTXprh2EcJzah6
 =cnx5
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-4.16-1' of git://github.com/cminyard/linux-ipmi

Pull IPMI updates from Corey Minyard:
 "Small fixes for various things, been sitting in next for a while (some
  a long time)"

* tag 'for-linus-4.16-1' of git://github.com/cminyard/linux-ipmi:
  ipmi_ssif: Remove duplicate NULL check
  ipmi/powernv: Fix error return code in ipmi_powernv_probe()
  ipmi: use dynamic memory for DMI driver override
  ipmi/ipmi_powernv: remove outdated todo in powernv IPMI driver
  ipmi: Clear smi_info->thread to prevent use-after-free during module unload
  ipmi: use correct string length
  ipmi_si: Fix error handling of platform device
  ipmi watchdog: fix typo in parameter description
  ipmi_si_platform: Fix typo in parameter description
This commit is contained in:
Linus Torvalds 2018-01-31 12:58:15 -08:00
commit 4c6790c49a
7 changed files with 21 additions and 14 deletions

View File

@ -106,7 +106,10 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
pr_err("ipmi:dmi: Error allocation IPMI platform device\n");
return;
}
pdev->driver_override = override;
pdev->driver_override = kasprintf(GFP_KERNEL, "%s",
override);
if (!pdev->driver_override)
goto err;
if (type == IPMI_DMI_TYPE_SSIF) {
set_prop_entry(p[pidx++], "i2c-addr", u16, base_addr);

View File

@ -84,7 +84,7 @@ static int panic_op_write_handler(const char *val,
char valcp[16];
char *s;
strncpy(valcp, val, 16);
strncpy(valcp, val, 15);
valcp[15] = '\0';
s = strstrip(valcp);

View File

@ -250,8 +250,9 @@ static int ipmi_powernv_probe(struct platform_device *pdev)
ipmi->irq = opal_event_request(prop);
}
if (request_irq(ipmi->irq, ipmi_opal_event, IRQ_TYPE_LEVEL_HIGH,
"opal-ipmi", ipmi)) {
rc = request_irq(ipmi->irq, ipmi_opal_event, IRQ_TYPE_LEVEL_HIGH,
"opal-ipmi", ipmi);
if (rc) {
dev_warn(dev, "Unable to request irq\n");
goto err_dispose;
}
@ -264,7 +265,6 @@ static int ipmi_powernv_probe(struct platform_device *pdev)
goto err_unregister;
}
/* todo: query actual ipmi_device_id */
rc = ipmi_register_smi(&ipmi_powernv_smi_handlers, ipmi, dev, 0);
if (rc) {
dev_warn(dev, "IPMI SMI registration failed (%d)\n", rc);

View File

@ -1938,8 +1938,10 @@ static void check_for_broken_irqs(struct smi_info *smi_info)
static inline void stop_timer_and_thread(struct smi_info *smi_info)
{
if (smi_info->thread != NULL)
if (smi_info->thread != NULL) {
kthread_stop(smi_info->thread);
smi_info->thread = NULL;
}
smi_info->timer_can_start = false;
if (smi_info->timer_running)
@ -2045,6 +2047,7 @@ static int try_smi_init(struct smi_info *new_smi)
int rv = 0;
int i;
char *init_name = NULL;
bool platform_device_registered = false;
pr_info(PFX "Trying %s-specified %s state machine at %s address 0x%lx, slave address 0x%x, irq %d\n",
ipmi_addr_src_to_str(new_smi->io.addr_source),
@ -2173,6 +2176,7 @@ static int try_smi_init(struct smi_info *new_smi)
rv);
goto out_err;
}
platform_device_registered = true;
}
dev_set_drvdata(new_smi->io.dev, new_smi);
@ -2279,10 +2283,11 @@ out_err:
}
if (new_smi->pdev) {
platform_device_unregister(new_smi->pdev);
if (platform_device_registered)
platform_device_unregister(new_smi->pdev);
else
platform_device_put(new_smi->pdev);
new_smi->pdev = NULL;
} else if (new_smi->pdev) {
platform_device_put(new_smi->pdev);
}
kfree(init_name);

View File

@ -40,7 +40,7 @@ MODULE_PARM_DESC(tryacpi, "Setting this to zero will disable the"
#endif
#ifdef CONFIG_OF
module_param_named(tryopenfirmware, si_tryopenfirmware, bool, 0);
MODULE_PARM_DESC(tryacpi, "Setting this to zero will disable the"
MODULE_PARM_DESC(tryopenfirmware, "Setting this to zero will disable the"
" default scan of the interfaces identified via OpenFirmware");
#endif
#ifdef CONFIG_DMI

View File

@ -2071,8 +2071,7 @@ static int ssif_platform_remove(struct platform_device *dev)
return 0;
mutex_lock(&ssif_infos_mutex);
if (addr_info->client)
i2c_unregister_device(addr_info->client);
i2c_unregister_device(addr_info->client);
list_del(&addr_info->link);
kfree(addr_info);

View File

@ -232,7 +232,7 @@ static int set_param_str(const char *val, const struct kernel_param *kp)
char valcp[16];
char *s;
strncpy(valcp, val, 16);
strncpy(valcp, val, 15);
valcp[15] = '\0';
s = strstrip(valcp);
@ -298,7 +298,7 @@ module_param(pretimeout, timeout, 0644);
MODULE_PARM_DESC(pretimeout, "Pretimeout value in seconds.");
module_param(panic_wdt_timeout, timeout, 0644);
MODULE_PARM_DESC(timeout, "Timeout value on kernel panic in seconds.");
MODULE_PARM_DESC(panic_wdt_timeout, "Timeout value on kernel panic in seconds.");
module_param_cb(action, &param_ops_str, action_op, 0644);
MODULE_PARM_DESC(action, "Timeout action. One of: "