lkml.org 
[lkml]   [2012]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: usbip: stub_dev: Fixed oops during removal of usbip_host
On Tue, Sep 18, 2012 at 03:02:15PM +0530, navin patidar wrote:
> On Tue, Sep 18, 2012 at 1:10 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Tue, Sep 18, 2012 at 09:30:06AM +0530, navin patidar wrote:
> >> stub_device_reset should set kernel thread pointers to NULL.
> >> so that at the time of usbip_host removal stub_shoutdown_connection
> >> doesn't try to kill kernel threads which are already killed.
> >>
> >
> > If you have the Oops output, that's always nice to put in the commit
> > message.
>
> i'll surely keep this in mind before submitting further patches.
>
> > Why don't you set the pointers to NULL in stub_shutdown_connection()
> > since that's where you actually kill the threads. Setting them to
> > NULL in stub_device_reset() will (sometimes) solve the problem but
> > it gives you a new problem of a resource leak.
>
> stub_device_reset() always gets executed after
> stub_shutdown_connection() , never before.
>

No it isn't. Read event_handler() more carefully. They can be
executed independently.

In other words, stub_shutdown_connection() can be called without
calling stub_device_reset() and stub_device_reset() can be called
without stub_shutdown_connection(). If either of those happen then
it causes a problem with the patch you have just sent.

regards,
dan carpenter



\
 
 \ /
  Last update: 2012-09-18 12:21    [W:0.062 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site