summaryrefslogtreecommitdiff
path: root/drivers/firewire/nosy.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2021-04-07 13:34:18 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2021-04-07 13:34:18 +0200
commit816b5bcff6fe2e18ee7e30a300c13e1e97d51f23 (patch)
tree440ad4885111bdc92d9ae4be4a400d763cf178d6 /drivers/firewire/nosy.c
parent7a842f5f3a816a818dc89e4ec4cffb7a32a38543 (diff)
parenta0c646821e9dedc5368abd2f71f50ebe2c351d19 (diff)
Merge 4.4.265 into android-4.4-p
Changes in 4.4.265 selinux: vsock: Set SID for socket returned by accept() ipv6: weaken the v4mapped source check ext4: fix bh ref count on error paths rpc: fix NULL dereference on kmalloc failure ASoC: rt5640: Fix dac- and adc- vol-tlv values being off by a factor of 10 ASoC: rt5651: Fix dac- and adc- vol-tlv values being off by a factor of 10 ASoC: sgtl5000: set DAP_AVC_CTRL register to correct default value on probe scsi: st: Fix a use after free in st_open() scsi: qla2xxx: Fix broken #endif placement staging: comedi: cb_pcidas: fix request_irq() warn staging: comedi: cb_pcidas64: fix request_irq() warn ext4: do not iput inode under running transaction in ext4_rename() appletalk: Fix skb allocation size in loopback case net: wan/lmc: unregister device when no matching device is found ALSA: usb-audio: Apply sample rate quirk to Logitech Connect ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook tracing: Fix stack trace event size mm: fix race by making init_zero_pfn() early_initcall reiserfs: update reiserfs_xattrs_initialized() condition pinctrl: rockchip: fix restore error in resume extcon: Fix error handling in extcon_dev_register firewire: nosy: Fix a use-after-free bug in nosy_ioctl() USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem cdc-acm: fix BREAK rx code path adding necessary calls USB: cdc-acm: downgrade message to debug USB: cdc-acm: fix use-after-free after probe failure staging: rtl8192e: Fix incorrect source in memcpy() staging: rtl8192e: Change state information from u16 to u8 Linux 4.4.265 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I23368777e608080ef12898664935fe7394c5f40d
Diffstat (limited to 'drivers/firewire/nosy.c')
-rw-r--r--drivers/firewire/nosy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 76b2d390f6ec..40ed4d8c61f5 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -358,6 +358,7 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct client *client = file->private_data;
spinlock_t *client_list_lock = &client->lynx->client_list_lock;
struct nosy_stats stats;
+ int ret;
switch (cmd) {
case NOSY_IOC_GET_STATS:
@@ -372,11 +373,15 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return 0;
case NOSY_IOC_START:
+ ret = -EBUSY;
spin_lock_irq(client_list_lock);
- list_add_tail(&client->link, &client->lynx->client_list);
+ if (list_empty(&client->link)) {
+ list_add_tail(&client->link, &client->lynx->client_list);
+ ret = 0;
+ }
spin_unlock_irq(client_list_lock);
- return 0;
+ return ret;
case NOSY_IOC_STOP:
spin_lock_irq(client_list_lock);