Skip to content

Commit ab91292

Browse files
committed
Merge tag 'char-misc-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small driver fixes, and one "large" revert, for 5.10-rc7. They include: - revert mei patch from 5.10-rc1 that was using a reserved userspace value. It will be resubmitted once the proper id has been assigned by the virtio people. - habanalabs fixes found by the fall-through audit from Gustavo - speakup driver fixes for reported issues - fpga config build fix for reported issue. All of these except the revert have been in linux-next with no reported issues. The revert is "clean" and just removes a previously-added driver, so no real issue there" * tag 'char-misc-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Revert "mei: virtio: virtualization frontend driver" fpga: Specify HAS_IOMEM dependency for FPGA_DFL habanalabs: put devices before driver removal habanalabs: free host huge va_range if not used speakup: Reject setting the speakup line discipline outside of speakup
2 parents d49248e + 264f53b commit ab91292

File tree

7 files changed

+33
-909
lines changed

7 files changed

+33
-909
lines changed

drivers/accessibility/speakup/spk_ttyio.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,20 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
4747
{
4848
struct spk_ldisc_data *ldisc_data;
4949

50+
if (tty != speakup_tty)
51+
/* Somebody tried to use this line discipline outside speakup */
52+
return -ENODEV;
53+
5054
if (!tty->ops->write)
5155
return -EOPNOTSUPP;
5256

53-
mutex_lock(&speakup_tty_mutex);
54-
if (speakup_tty) {
55-
mutex_unlock(&speakup_tty_mutex);
56-
return -EBUSY;
57-
}
58-
speakup_tty = tty;
59-
6057
ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL);
61-
if (!ldisc_data) {
62-
speakup_tty = NULL;
63-
mutex_unlock(&speakup_tty_mutex);
58+
if (!ldisc_data)
6459
return -ENOMEM;
65-
}
6660

6761
init_completion(&ldisc_data->completion);
6862
ldisc_data->buf_free = true;
69-
speakup_tty->disc_data = ldisc_data;
70-
mutex_unlock(&speakup_tty_mutex);
63+
tty->disc_data = ldisc_data;
7164

7265
return 0;
7366
}
@@ -191,9 +184,25 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
191184

192185
tty_unlock(tty);
193186

187+
mutex_lock(&speakup_tty_mutex);
188+
speakup_tty = tty;
194189
ret = tty_set_ldisc(tty, N_SPEAKUP);
195190
if (ret)
196-
pr_err("speakup: Failed to set N_SPEAKUP on tty\n");
191+
speakup_tty = NULL;
192+
mutex_unlock(&speakup_tty_mutex);
193+
194+
if (!ret)
195+
/* Success */
196+
return 0;
197+
198+
pr_err("speakup: Failed to set N_SPEAKUP on tty\n");
199+
200+
tty_lock(tty);
201+
if (tty->ops->close)
202+
tty->ops->close(tty, NULL);
203+
tty_unlock(tty);
204+
205+
tty_kclose(tty);
197206

198207
return ret;
199208
}

drivers/fpga/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ config FPGA_DFL
142142
tristate "FPGA Device Feature List (DFL) support"
143143
select FPGA_BRIDGE
144144
select FPGA_REGION
145+
depends on HAS_IOMEM
145146
help
146147
Device Feature List (DFL) defines a feature list structure that
147148
creates a linked list of feature headers within the MMIO space

drivers/misc/habanalabs/common/device.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ static int device_cdev_sysfs_add(struct hl_device *hdev)
231231

232232
static void device_cdev_sysfs_del(struct hl_device *hdev)
233233
{
234-
/* device_release() won't be called so must free devices explicitly */
235-
if (!hdev->cdev_sysfs_created) {
236-
kfree(hdev->dev_ctrl);
237-
kfree(hdev->dev);
238-
return;
239-
}
234+
if (!hdev->cdev_sysfs_created)
235+
goto put_devices;
240236

241237
hl_sysfs_fini(hdev);
242238
cdev_device_del(&hdev->cdev_ctrl, hdev->dev_ctrl);
243239
cdev_device_del(&hdev->cdev, hdev->dev);
240+
241+
put_devices:
242+
put_device(hdev->dev);
243+
put_device(hdev->dev_ctrl);
244244
}
245245

246246
/*
@@ -1371,9 +1371,9 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)
13711371
early_fini:
13721372
device_early_fini(hdev);
13731373
free_dev_ctrl:
1374-
kfree(hdev->dev_ctrl);
1374+
put_device(hdev->dev_ctrl);
13751375
free_dev:
1376-
kfree(hdev->dev);
1376+
put_device(hdev->dev);
13771377
out_disabled:
13781378
hdev->disabled = true;
13791379
if (add_cdev_sysfs_on_err)

drivers/misc/habanalabs/common/memory.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx,
16261626
goto host_hpage_range_err;
16271627
}
16281628
} else {
1629+
kfree(ctx->host_huge_va_range);
16291630
ctx->host_huge_va_range = ctx->host_va_range;
16301631
}
16311632

drivers/misc/mei/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,4 @@ config INTEL_MEI_TXE
4646
Supported SoCs:
4747
Intel Bay Trail
4848

49-
config INTEL_MEI_VIRTIO
50-
tristate "Intel MEI interface emulation with virtio framework"
51-
select INTEL_MEI
52-
depends on X86 && PCI && VIRTIO_PCI
53-
help
54-
This module implements mei hw emulation over virtio transport.
55-
The module will be called mei_virtio.
56-
Enable this if your virtual machine supports virtual mei
57-
device over virtio.
58-
5949
source "drivers/misc/mei/hdcp/Kconfig"

drivers/misc/mei/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ obj-$(CONFIG_INTEL_MEI_TXE) += mei-txe.o
2222
mei-txe-objs := pci-txe.o
2323
mei-txe-objs += hw-txe.o
2424

25-
obj-$(CONFIG_INTEL_MEI_VIRTIO) += mei-virtio.o
26-
mei-virtio-objs := hw-virtio.o
27-
2825
mei-$(CONFIG_EVENT_TRACING) += mei-trace.o
2926
CFLAGS_mei-trace.o = -I$(src)
3027

0 commit comments

Comments
 (0)