From: Ian Abbott Date: Fri, 8 Nov 2013 15:03:36 +0000 (+0000) Subject: staging: comedi: use refcount while reading /proc/comedi X-Git-Tag: v3.14-rc1~150^2~775^2~89 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=616a3548e816553c31d57cc211a86d327a192e12;p=pandora-kernel.git staging: comedi: use refcount while reading /proc/comedi In the seq_file 'show' handler for "/proc/comedi" - `comedi_read()` in "comedi/proc.c", call `comedi_dev_get_from_minor()` instead of `comedi_dev_from_minor()` to increment the reference counter for the `struct comedi_device` while it is being examined. Call `comedi_dev_put()` to decrement the reference afterwards. Also acquire the `attach_lock` rwsem while checking whether the device is attached. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed