mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kurt Borja" <kuurtb@gmail.com>
To: "Armin Wolf" <W_Armin@gmx.de>,
	"Prasanth Ksr" <prasanth.ksr@dell.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Divya Bharathi" <divya.bharathi@dell.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Cc: <Dell.Client.Kernel@dell.com>,
	<platform-driver-x86@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Jan Graczyk" <jangraczyk@yahoo.ca>
Subject: Re: [PATCH] platform/x86: dell-wmi-sysman: Fix WMI data block retrieval in sysfs callbacks
Date: Sun, 29 Jun 2025 20:50:57 -0300	[thread overview]
Message-ID: <DAZF57H19N50.2CQE5TCAK4U0W@gmail.com> (raw)
In-Reply-To: <6a9b6660-acd2-44b4-a57e-2245043471ab@gmx.de>

On Sun Jun 29, 2025 at 8:37 PM -03, Armin Wolf wrote:
> Am 29.06.25 um 20:33 schrieb Kurt Borja:
>
>> After retrieving WMI data blocks in sysfs callbacks, check for the
>> validity of them before dereferencing their content.
>>
>> Reported-by: Jan Graczyk <jangraczyk@yahoo.ca>
>> Closes: https://lore.kernel.org/r/CAHk-=wgMiSKXf7SvQrfEnxVtmT=QVQPjJdNjfm3aXS7wc=rzTw@mail.gmail.com/
>> Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
>> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
>> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
>> ---
>>   drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h    | 7 +++++++
>>   drivers/platform/x86/dell/dell-wmi-sysman/enum-attributes.c    | 5 +++--
>>   drivers/platform/x86/dell/dell-wmi-sysman/int-attributes.c     | 5 +++--
>>   drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c | 5 +++--
>>   drivers/platform/x86/dell/dell-wmi-sysman/string-attributes.c  | 5 +++--
>>   drivers/platform/x86/dell/dell-wmi-sysman/sysman.c             | 8 ++++----
>>   6 files changed, 23 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h b/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
>> index 3ad33a094588c6a258786a02f952eaa6bf953234..792e7d865bfb1cfc13b59c90ddf7de47feff408f 100644
>> --- a/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
>> +++ b/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
>> @@ -89,6 +89,13 @@ extern struct wmi_sysman_priv wmi_priv;
>>   
>>   enum { ENUM, INT, STR, PO };
>>   
>> +enum {
>> +	ENUM_MIN_ELEMENTS	= 8,
>> +	INT_MIN_ELEMENTS	= 9,
>> +	STR_MIN_ELEMENTS	= 8,
>> +	PO_MIN_ELEMENTS		= 4,
>> +};
>
> Hi,
>
> are you sure that this works? I suggest we use defines instead as ENUM_MIN_ELEMENTS has the same value as STR_MIN_ELEMENTS.

Oh - I wrote that without thinking...

I'm pretty sure it works, but I'll go with defines anyway.

>
> For the rest:
>
> Reviewed-by: Armin Wolf <W_Armin@gmx.de>

Thanks!


-- 
 ~ Kurt

      reply	other threads:[~2025-06-29 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-29 18:33 Kurt Borja
2025-06-29 23:37 ` Armin Wolf
2025-06-29 23:50   ` Kurt Borja [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DAZF57H19N50.2CQE5TCAK4U0W@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=W_Armin@gmx.de \
    --cc=divya.bharathi@dell.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jangraczyk@yahoo.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=prasanth.ksr@dell.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®