On Mon, Nov 13, 2017 at 02:51:55PM +0000, Mario.Limonciello@xxxxxxxx wrote: > > -----Original Message----- > > From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx] > > Sent: Monday, November 13, 2017 4:06 AM > > To: Darren Hart <dvhart@xxxxxxxxxxxxx>; Limonciello, Mario > > <Mario_Limonciello@xxxxxxxx> > > Cc: Andy Shevchenko <andy@xxxxxxxxxxxxx>; platform-driver- > > x86@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx > > Subject: [PATCH] platform/x86: wmi: Unlock on error in wmi_ioctl() > > > > We need to drop a lock if try_module_get() fails. > > > > Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers") > > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > > > diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c > > index 8c31ed4f0e1b..791449a2370f 100644 > > --- a/drivers/platform/x86/wmi.c > > +++ b/drivers/platform/x86/wmi.c > > @@ -868,8 +868,10 @@ static long wmi_ioctl(struct file *filp, unsigned int cmd, > > unsigned long arg) > > /* let the driver do any filtering and do the call */ > > wdriver = container_of(wblock->dev.dev.driver, > > struct wmi_driver, driver); > > - if (!try_module_get(wdriver->driver.owner)) > > - return -EBUSY; > > + if (!try_module_get(wdriver->driver.owner)) { > > + ret = -EBUSY; > > + goto out_ioctl; > > + } > > ret = wdriver->filter_callback(&wblock->dev, cmd, buf); > > module_put(wdriver->driver.owner); > > if (ret) > > Hi Dan, > > Thanks for submitting. This exact same fix is in the subsystem "testing" branch > but hasn't yet been promoted to -next. > > http://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git/commit/5e3e22971fb0b0d7d03286f1a619d0348748a243 And Mario's versions have now been pushed to for-next. > > -- Darren Hart VMware Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html