diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-10-06 11:24:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-17 17:41:03 -0400 |
commit | 2da41d5f6c036e7a6e496a7e601a685f8b87acb0 (patch) | |
tree | f3bbc143b16e63fa3950f3379851504add6e4d97 /drivers/usb | |
parent | bb78a825fa91621e52b9a5409fd9ef07895275bf (diff) |
USB: snoop processes opening usbfs device files
This patch (as1148) adds a new "snoop" message to usbfs when a device
file is opened, identifying the process responsible. This comes in
extremely handy when trying to determine which program is doing some
unwanted USB access.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 7a4fa791dc19..528befdcc781 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -624,6 +624,8 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
624 | smp_wmb(); | 624 | smp_wmb(); |
625 | list_add_tail(&ps->list, &dev->filelist); | 625 | list_add_tail(&ps->list, &dev->filelist); |
626 | file->private_data = ps; | 626 | file->private_data = ps; |
627 | snoop(&dev->dev, "opened by process %d: %s\n", task_pid_nr(current), | ||
628 | current->comm); | ||
627 | out: | 629 | out: |
628 | if (ret) { | 630 | if (ret) { |
629 | kfree(ps); | 631 | kfree(ps); |