Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1620221 > unrolled thread

[PATCH] ipmi_si: use smi_num for init_name

Started byTony Camuso <tcamuso@redhat.com>
First post2017-04-10 18:30 +0200
Last post2017-04-10 19:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ipmi_si: use smi_num for init_name Tony Camuso <tcamuso@redhat.com> - 2017-04-10 18:30 +0200
    Re: [PATCH] ipmi_si: use smi_num for init_name Corey Minyard <minyard@acm.org> - 2017-04-10 19:10 +0200

#1620221 — [PATCH] ipmi_si: use smi_num for init_name

FromTony Camuso <tcamuso@redhat.com>
Date2017-04-10 18:30 +0200
Subject[PATCH] ipmi_si: use smi_num for init_name
Message-ID<tuKmu-341-25@gated-at.bofh.it>
Commit 1abf71e moved the creation of new_smi->dev to earlier in the init
sequence in order to provide infrastructure for log printing.

However, the init_name was created with a hard-coded value of zero. This
presents a problem in systems with more than one interface, producing a
call trace in dmesg.

To correct the problem, simply use smi_num instead of the hard-coded
value of zero.

Tested on a lenovo x3950.

Signed-off-by: Tony Camuso <tcamuso@redhat.com>
---
 drivers/char/ipmi/ipmi_si_intf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 2a7c425..9d8fc51 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -3526,7 +3526,7 @@ static int try_smi_init(struct smi_info *new_smi)
 
 	/* Do this early so it's available for logs. */
 	if (!new_smi->dev) {
-		init_name = kasprintf(GFP_KERNEL, "ipmi_si.%d", 0);
+		init_name = kasprintf(GFP_KERNEL, "ipmi_si.%d", smi_num);
 
 		/*
 		 * If we don't already have a device from something
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1620395

FromCorey Minyard <minyard@acm.org>
Date2017-04-10 19:10 +0200
Message-ID<tuKZd-3CL-59@gated-at.bofh.it>
In reply to#1620221
On 04/10/2017 11:22 AM, Tony Camuso wrote:
> Commit 1abf71e moved the creation of new_smi->dev to earlier in the init
> sequence in order to provide infrastructure for log printing.
>
> However, the init_name was created with a hard-coded value of zero. This
> presents a problem in systems with more than one interface, producing a
> call trace in dmesg.
>
> To correct the problem, simply use smi_num instead of the hard-coded
> value of zero.

Yeah, you are right.  And there's more, the platform_device_alloc will
also be wrong, which is even worse.

I'll revise your patch a bit...

-corey

> Tested on a lenovo x3950.
>
> Signed-off-by: Tony Camuso <tcamuso@redhat.com>
> ---
>   drivers/char/ipmi/ipmi_si_intf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 2a7c425..9d8fc51 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -3526,7 +3526,7 @@ static int try_smi_init(struct smi_info *new_smi)
>   
>   	/* Do this early so it's available for logs. */
>   	if (!new_smi->dev) {
> -		init_name = kasprintf(GFP_KERNEL, "ipmi_si.%d", 0);
> +		init_name = kasprintf(GFP_KERNEL, "ipmi_si.%d", smi_num);
>   
>   		/*
>   		 * If we don't already have a device from something

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web