aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-debug.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2023-12-01 00:10:40 +0000
committerJakub Kicinski <[email protected]>2023-12-01 00:11:19 +0000
commit975f2d73a99f35b57ffa2ad7bff8562225cdcfcb (patch)
treed6c9ce96cfd889281e003a310c79d5a12a3cf924 /drivers/hid/hid-debug.c
parentnet: page_pool: fix general protection fault in page_pool_unlist (diff)
parentMerge tag 'net-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff)
downloadkernel-975f2d73a99f35b57ffa2ad7bff8562225cdcfcb.tar.gz
kernel-975f2d73a99f35b57ffa2ad7bff8562225cdcfcb.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts. Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/hid/hid-debug.c')
-rw-r--r--drivers/hid/hid-debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index e7ef1ea107c9..7dd83ec74f8a 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1135,6 +1135,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file)
goto out;
}
list->hdev = (struct hid_device *) inode->i_private;
+ kref_get(&list->hdev->ref);
file->private_data = list;
mutex_init(&list->read_mutex);
@@ -1227,6 +1228,8 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)
list_del(&list->node);
spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags);
kfifo_free(&list->hid_debug_fifo);
+
+ kref_put(&list->hdev->ref, hiddev_free);
kfree(list);
return 0;