Re: [PATCH] usb: gadget: u_serial: Add null pointer check in gserial_resume

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

 





And this seems like a viable option to me, what do you suggest?

gserial_disconnect {
     spin_lock(static)
     spin_lock(port)
     ...
     gser->ioport = NULL;
     ...
     spin_lock(port)
     spin_unlock(static)

}

gserial_resume {
     struct gs_port *port = gser->ioport;

     spin_lock(static)
     if (!port)
	   spin_unlock(static)
         return
     spin_lock(port)

     ...
     spin_unlock(port)
     spin_unlock(static)
}

Thanks,
Prashanth K
Small correction inlined.




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux