Re: [PATCH] WMI: properly cleanup devices to avoid crashes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 06 Oct 2011 15:40:44 Dmitry Torokhov wrote:
> On Wed, Sep 07, 2011 at 03:00:02PM -0700, Dmitry Torokhov wrote:
> > We need to remove devices that we destroy from the list, otherwise
> > we'll crash if there are more than one "_WDG" methods in DSDT.
> > 
> > This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052
> > 
> > Tested-by: Ilya Tumaykin <librarian_rus@xxxxxxxxx>
> > Cc: stable@xxxxxxxxxx
> > Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>

Acked-by: Carlos Corbacho <carlos@xxxxxxxxxxxxxxxxxxx>

> > ---
> 
> * ping *
> 
> >  drivers/platform/x86/wmi.c |    6 +++++-
> >  1 files changed, 5 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> > index f23d5a8..9b88be4 100644
> > --- a/drivers/platform/x86/wmi.c
> > +++ b/drivers/platform/x86/wmi.c
> > @@ -754,9 +754,13 @@ static void wmi_free_devices(void)
> > 
> >  	struct wmi_block *wblock, *next;
> >  	
> >  	/* Delete devices for all the GUIDs */
> > 
> > -	list_for_each_entry_safe(wblock, next, &wmi_block_list, list)
> > +	list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
> > +		list_del(&wblock->list);
> > 
> >  		if (wblock->dev.class)
> >  		
> >  			device_unregister(&wblock->dev);
> > 
> > +		else
> > +			kfree(wblock);
> > +	}
> > 
> >  }
> >  
> >  static bool guid_already_parsed(const char *guid_string)
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux