lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 13/14] platform/x86: wmi: create character devices when requested by drivers
On Tue, 10 Oct 2017 19:24:11 +0000
<Mario.Limonciello@dell.com> wrote:

> > -----Original Message-----
> > From: Pali Rohár [mailto:pali.rohar@gmail.com]
> > Sent: Tuesday, October 10, 2017 2:12 PM
> > To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> > Cc: dvhart@infradead.org; Andy Shevchenko <andy.shevchenko@gmail.com>;
> > LKML <linux-kernel@vger.kernel.org>; platform-driver-x86@vger.kernel.org;
> > Andy Lutomirski <luto@kernel.org>; quasisec@google.com; rjw@rjwysocki.net;
> > mjg59@google.com; hch@lst.de; Greg KH <greg@kroah.com>
> > Subject: Re: [PATCH v6 13/14] platform/x86: wmi: create character devices when
> > requested by drivers
> >
> > On Monday 09 October 2017 17:51:51 Mario Limonciello wrote:
> > > + /* make sure we're not calling a higher instance than exists*/
> > > + if (_IOC_NR(cmd) > wblock->gblock.instance_count - 1)
> > > + return -EINVAL;
> >
> > Is this condition really working? instance_count is unsigned, cmd is
> > also unsigned... and when instance_count is zero, then IIRC error would
> > not be thrown.
> >
>
> But instance count can't be zero. MOF would fall apart with a zero instance count.
> If a broken BIOS was shipped with an instance count of zero bigger problems would
> have happened.

Maybe but you can still write the test correctly using >= instead.

Alan

\
 
 \ /
  Last update: 2017-10-11 14:34    [W:0.075 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site