Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932809AbdDJQ74 (ORCPT ); Mon, 10 Apr 2017 12:59:56 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36748 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755716AbdDJQ7w (ORCPT ); Mon, 10 Apr 2017 12:59:52 -0400 Reply-To: minyard@acm.org Subject: Re: [PATCH] ipmi_si: use smi_num for init_name References: <20170410162213.6906-1-tcamuso@redhat.com> To: Tony Camuso , openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org From: Corey Minyard Message-ID: Date: Mon, 10 Apr 2017 11:59:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170410162213.6906-1-tcamuso@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1326 Lines: 39 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 > --- > 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