Skip to content

Commit df60eac

Browse files
committed
Merge tag 'for-linus-6.14-1' of https://github.com/cminyard/linux-ipmi
Pull ipmi updates from Corey Minyard: - I'm switching to a new email address, so update that - Minor fixes for formats and return values and missing ifdefs - A fix for some error handling that causes a loss of messages * tag 'for-linus-6.14-1' of https://github.com/cminyard/linux-ipmi: MAINTAINERS: ipmi: update my email address ipmi: ssif_bmc: Fix new request loss when bmc ready for a response ipmi: make ipmi_destroy_user() return void char:ipmi: Fix a not-used variable on a non-ACPI system char:ipmi: Fix the wrong format specifier ipmi: ipmb: Add check devm_kasprintf() returned value
2 parents 641b0c6 + b4339d5 commit df60eac

File tree

9 files changed

+15
-21
lines changed

9 files changed

+15
-21
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12118,7 +12118,7 @@ F: include/uapi/linux/io_uring.h
1211812118
F: io_uring/
1211912119

1212012120
IPMI SUBSYSTEM
12121-
M: Corey Minyard <[email protected]>
12121+
M: Corey Minyard <[email protected]>
1212212122
L: [email protected] (moderated for non-subscribers)
1212312123
S: Supported
1212412124
W: http://openipmi.sourceforge.net/

drivers/char/ipmi/ipmb_dev_int.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ static int ipmb_probe(struct i2c_client *client)
321321
ipmb_dev->miscdev.name = devm_kasprintf(&client->dev, GFP_KERNEL,
322322
"%s%d", "ipmb-",
323323
client->adapter->nr);
324+
if (!ipmb_dev->miscdev.name)
325+
return -ENOMEM;
326+
324327
ipmb_dev->miscdev.fops = &ipmb_fops;
325328
ipmb_dev->miscdev.parent = &client->dev;
326329
ret = misc_register(&ipmb_dev->miscdev);
@@ -355,11 +358,13 @@ static const struct i2c_device_id ipmb_id[] = {
355358
};
356359
MODULE_DEVICE_TABLE(i2c, ipmb_id);
357360

361+
#ifdef CONFIG_ACPI
358362
static const struct acpi_device_id acpi_ipmb_id[] = {
359363
{ "IPMB0001", 0 },
360364
{},
361365
};
362366
MODULE_DEVICE_TABLE(acpi, acpi_ipmb_id);
367+
#endif
363368

364369
static struct i2c_driver ipmb_driver = {
365370
.driver = {

drivers/char/ipmi/ipmi_devintf.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,9 @@ static int ipmi_open(struct inode *inode, struct file *file)
122122
static int ipmi_release(struct inode *inode, struct file *file)
123123
{
124124
struct ipmi_file_private *priv = file->private_data;
125-
int rv;
126125
struct ipmi_recv_msg *msg, *next;
127126

128-
rv = ipmi_destroy_user(priv->user);
129-
if (rv)
130-
return rv;
127+
ipmi_destroy_user(priv->user);
131128

132129
list_for_each_entry_safe(msg, next, &priv->recv_msgs, link)
133130
ipmi_free_recv_msg(msg);

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,13 +1398,11 @@ static void _ipmi_destroy_user(struct ipmi_user *user)
13981398
module_put(owner);
13991399
}
14001400

1401-
int ipmi_destroy_user(struct ipmi_user *user)
1401+
void ipmi_destroy_user(struct ipmi_user *user)
14021402
{
14031403
_ipmi_destroy_user(user);
14041404

14051405
kref_put(&user->refcount, free_user);
1406-
1407-
return 0;
14081406
}
14091407
EXPORT_SYMBOL(ipmi_destroy_user);
14101408

drivers/char/ipmi/ipmi_poweroff.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,18 +699,14 @@ static int __init ipmi_poweroff_init(void)
699699
#ifdef MODULE
700700
static void __exit ipmi_poweroff_cleanup(void)
701701
{
702-
int rv;
703-
704702
#ifdef CONFIG_PROC_FS
705703
unregister_sysctl_table(ipmi_table_header);
706704
#endif
707705

708706
ipmi_smi_watcher_unregister(&smi_watcher);
709707

710708
if (ready) {
711-
rv = ipmi_destroy_user(ipmi_user);
712-
if (rv)
713-
pr_err("could not cleanup the IPMI user: 0x%x\n", rv);
709+
ipmi_destroy_user(ipmi_user);
714710
pm_power_off = old_poweroff_func;
715711
}
716712
}

drivers/char/ipmi/ipmi_si_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
118118
if (io.irq)
119119
io.irq_setup = ipmi_std_irq_setup;
120120

121-
dev_info(&pdev->dev, "%pR regsize %d spacing %d irq %d\n",
121+
dev_info(&pdev->dev, "%pR regsize %u spacing %u irq %d\n",
122122
&pdev->resource[0], io.regsize, io.regspacing, io.irq);
123123

124124
return ipmi_si_add_smi(&io);

drivers/char/ipmi/ipmi_watchdog.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ static void ipmi_register_watchdog(int ipmi_intf)
10641064

10651065
static void ipmi_unregister_watchdog(int ipmi_intf)
10661066
{
1067-
int rv;
10681067
struct ipmi_user *loc_user = watchdog_user;
10691068

10701069
if (!loc_user)
@@ -1089,9 +1088,7 @@ static void ipmi_unregister_watchdog(int ipmi_intf)
10891088
mutex_lock(&ipmi_watchdog_mutex);
10901089

10911090
/* Disconnect from IPMI. */
1092-
rv = ipmi_destroy_user(loc_user);
1093-
if (rv)
1094-
pr_warn("error unlinking from IPMI: %d\n", rv);
1091+
ipmi_destroy_user(loc_user);
10951092

10961093
/* If it comes back, restart it properly. */
10971094
ipmi_start_timer_on_heartbeat = 1;

drivers/char/ipmi/ssif_bmc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ static void complete_response(struct ssif_bmc_ctx *ssif_bmc)
292292
ssif_bmc->nbytes_processed = 0;
293293
ssif_bmc->remain_len = 0;
294294
ssif_bmc->busy = false;
295-
memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
296295
wake_up_all(&ssif_bmc->wait_queue);
297296
}
298297

@@ -744,9 +743,11 @@ static void on_stop_event(struct ssif_bmc_ctx *ssif_bmc, u8 *val)
744743
ssif_bmc->aborting = true;
745744
}
746745
} else if (ssif_bmc->state == SSIF_RES_SENDING) {
747-
if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF)
746+
if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF) {
747+
memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
748748
/* Invalidate response buffer to denote it is sent */
749749
complete_response(ssif_bmc);
750+
}
750751
ssif_bmc->state = SSIF_READY;
751752
}
752753

include/linux/ipmi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ int ipmi_create_user(unsigned int if_num,
126126
* the users before you destroy the callback structures, it should be
127127
* safe, too.
128128
*/
129-
int ipmi_destroy_user(struct ipmi_user *user);
129+
void ipmi_destroy_user(struct ipmi_user *user);
130130

131131
/* Get the IPMI version of the BMC we are talking to. */
132132
int ipmi_get_version(struct ipmi_user *user,

0 commit comments

Comments
 (0)