Skip to content

Commit 07b5ca2

Browse files
committed
Merge tag 'char-misc-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are a small number of char and misc driver fixes for 4.7-rc4. They resolve some minor issues that have been reported, and have all been in linux-next" * tag 'char-misc-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: coresight: Handle build path error coresight: Fix erroneous memset in tmc_read_unprepare_etr coresight: Fix tmc_read_unprepare_etr coresight: Fix NULL pointer dereference in _coresight_build_path extcon: palmas: Fix boot up state of VBUS when using GPIO detection mcb: Acquire reference to carrier module in core mcb: Acquire reference to device in probe mei: don't use wake_up_interruptible for wr_ctrl
2 parents 4c6459f + 5014e90 commit 07b5ca2

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

drivers/extcon/extcon-palmas.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
360360

361361
palmas_enable_irq(palmas_usb);
362362
/* perform initial detection */
363+
if (palmas_usb->enable_gpio_vbus_detection)
364+
palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
363365
palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
364366
device_set_wakeup_capable(&pdev->dev, true);
365367
return 0;

drivers/hwtracing/coresight/coresight-tmc-etr.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,10 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
300300
if (local_read(&drvdata->mode) == CS_MODE_SYSFS) {
301301
/*
302302
* The trace run will continue with the same allocated trace
303-
* buffer. As such zero-out the buffer so that we don't end
304-
* up with stale data.
305-
*
306-
* Since the tracer is still enabled drvdata::buf
307-
* can't be NULL.
303+
* buffer. The trace buffer is cleared in tmc_etr_enable_hw(),
304+
* so we don't have to explicitly clear it. Also, since the
305+
* tracer is still enabled drvdata::buf can't be NULL.
308306
*/
309-
memset(drvdata->buf, 0, drvdata->size);
310307
tmc_etr_enable_hw(drvdata);
311308
} else {
312309
/*
@@ -315,7 +312,7 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
315312
*/
316313
vaddr = drvdata->vaddr;
317314
paddr = drvdata->paddr;
318-
drvdata->buf = NULL;
315+
drvdata->buf = drvdata->vaddr = NULL;
319316
}
320317

321318
drvdata->reading = false;

drivers/hwtracing/coresight/coresight.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ static int _coresight_build_path(struct coresight_device *csdev,
385385
int i;
386386
bool found = false;
387387
struct coresight_node *node;
388-
struct coresight_connection *conn;
389388

390389
/* An activated sink has been found. Enqueue the element */
391390
if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
@@ -394,8 +393,9 @@ static int _coresight_build_path(struct coresight_device *csdev,
394393

395394
/* Not a sink - recursively explore each port found on this element */
396395
for (i = 0; i < csdev->nr_outport; i++) {
397-
conn = &csdev->conns[i];
398-
if (_coresight_build_path(conn->child_dev, path) == 0) {
396+
struct coresight_device *child_dev = csdev->conns[i].child_dev;
397+
398+
if (child_dev && _coresight_build_path(child_dev, path) == 0) {
399399
found = true;
400400
break;
401401
}
@@ -425,16 +425,18 @@ static int _coresight_build_path(struct coresight_device *csdev,
425425
struct list_head *coresight_build_path(struct coresight_device *csdev)
426426
{
427427
struct list_head *path;
428+
int rc;
428429

429430
path = kzalloc(sizeof(struct list_head), GFP_KERNEL);
430431
if (!path)
431432
return NULL;
432433

433434
INIT_LIST_HEAD(path);
434435

435-
if (_coresight_build_path(csdev, path)) {
436+
rc = _coresight_build_path(csdev, path);
437+
if (rc) {
436438
kfree(path);
437-
path = NULL;
439+
return ERR_PTR(rc);
438440
}
439441

440442
return path;
@@ -507,8 +509,9 @@ int coresight_enable(struct coresight_device *csdev)
507509
goto out;
508510

509511
path = coresight_build_path(csdev);
510-
if (!path) {
512+
if (IS_ERR(path)) {
511513
pr_err("building path(s) failed\n");
514+
ret = PTR_ERR(path);
512515
goto out;
513516
}
514517

drivers/mcb/mcb-core.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,36 @@ static int mcb_probe(struct device *dev)
6161
struct mcb_driver *mdrv = to_mcb_driver(dev->driver);
6262
struct mcb_device *mdev = to_mcb_device(dev);
6363
const struct mcb_device_id *found_id;
64+
struct module *carrier_mod;
65+
int ret;
6466

6567
found_id = mcb_match_id(mdrv->id_table, mdev);
6668
if (!found_id)
6769
return -ENODEV;
6870

69-
return mdrv->probe(mdev, found_id);
71+
carrier_mod = mdev->dev.parent->driver->owner;
72+
if (!try_module_get(carrier_mod))
73+
return -EINVAL;
74+
75+
get_device(dev);
76+
ret = mdrv->probe(mdev, found_id);
77+
if (ret)
78+
module_put(carrier_mod);
79+
80+
return ret;
7081
}
7182

7283
static int mcb_remove(struct device *dev)
7384
{
7485
struct mcb_driver *mdrv = to_mcb_driver(dev->driver);
7586
struct mcb_device *mdev = to_mcb_device(dev);
87+
struct module *carrier_mod;
7688

7789
mdrv->remove(mdev);
7890

91+
carrier_mod = mdev->dev.parent->driver->owner;
92+
module_put(carrier_mod);
93+
7994
put_device(&mdev->dev);
8095

8196
return 0;

drivers/misc/mei/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static void mei_cl_wake_all(struct mei_cl *cl)
730730
/* synchronized under device mutex */
731731
if (waitqueue_active(&cl->wait)) {
732732
cl_dbg(dev, cl, "Waking up ctrl write clients!\n");
733-
wake_up_interruptible(&cl->wait);
733+
wake_up(&cl->wait);
734734
}
735735
}
736736

0 commit comments

Comments
 (0)