Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Merge tag 'char-misc-4.7-rc4' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Jun 18, 2016
2 parents 4c6459f + 5014e90 commit 07b5ca2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
2 changes: 2 additions & 0 deletions drivers/extcon/extcon-palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)

palmas_enable_irq(palmas_usb);
/* perform initial detection */
if (palmas_usb->enable_gpio_vbus_detection)
palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
device_set_wakeup_capable(&pdev->dev, true);
return 0;
Expand Down
11 changes: 4 additions & 7 deletions drivers/hwtracing/coresight/coresight-tmc-etr.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,10 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
if (local_read(&drvdata->mode) == CS_MODE_SYSFS) {
/*
* The trace run will continue with the same allocated trace
* buffer. As such zero-out the buffer so that we don't end
* up with stale data.
*
* Since the tracer is still enabled drvdata::buf
* can't be NULL.
* buffer. The trace buffer is cleared in tmc_etr_enable_hw(),
* so we don't have to explicitly clear it. Also, since the
* tracer is still enabled drvdata::buf can't be NULL.
*/
memset(drvdata->buf, 0, drvdata->size);
tmc_etr_enable_hw(drvdata);
} else {
/*
Expand All @@ -315,7 +312,7 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
*/
vaddr = drvdata->vaddr;
paddr = drvdata->paddr;
drvdata->buf = NULL;
drvdata->buf = drvdata->vaddr = NULL;
}

drvdata->reading = false;
Expand Down
15 changes: 9 additions & 6 deletions drivers/hwtracing/coresight/coresight.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ static int _coresight_build_path(struct coresight_device *csdev,
int i;
bool found = false;
struct coresight_node *node;
struct coresight_connection *conn;

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

/* Not a sink - recursively explore each port found on this element */
for (i = 0; i < csdev->nr_outport; i++) {
conn = &csdev->conns[i];
if (_coresight_build_path(conn->child_dev, path) == 0) {
struct coresight_device *child_dev = csdev->conns[i].child_dev;

if (child_dev && _coresight_build_path(child_dev, path) == 0) {
found = true;
break;
}
Expand Down Expand Up @@ -425,16 +425,18 @@ static int _coresight_build_path(struct coresight_device *csdev,
struct list_head *coresight_build_path(struct coresight_device *csdev)
{
struct list_head *path;
int rc;

path = kzalloc(sizeof(struct list_head), GFP_KERNEL);
if (!path)
return NULL;

INIT_LIST_HEAD(path);

if (_coresight_build_path(csdev, path)) {
rc = _coresight_build_path(csdev, path);
if (rc) {
kfree(path);
path = NULL;
return ERR_PTR(rc);
}

return path;
Expand Down Expand Up @@ -507,8 +509,9 @@ int coresight_enable(struct coresight_device *csdev)
goto out;

path = coresight_build_path(csdev);
if (!path) {
if (IS_ERR(path)) {
pr_err("building path(s) failed\n");
ret = PTR_ERR(path);
goto out;
}

Expand Down
17 changes: 16 additions & 1 deletion drivers/mcb/mcb-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,36 @@ static int mcb_probe(struct device *dev)
struct mcb_driver *mdrv = to_mcb_driver(dev->driver);
struct mcb_device *mdev = to_mcb_device(dev);
const struct mcb_device_id *found_id;
struct module *carrier_mod;
int ret;

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

return mdrv->probe(mdev, found_id);
carrier_mod = mdev->dev.parent->driver->owner;
if (!try_module_get(carrier_mod))
return -EINVAL;

get_device(dev);
ret = mdrv->probe(mdev, found_id);
if (ret)
module_put(carrier_mod);

return ret;
}

static int mcb_remove(struct device *dev)
{
struct mcb_driver *mdrv = to_mcb_driver(dev->driver);
struct mcb_device *mdev = to_mcb_device(dev);
struct module *carrier_mod;

mdrv->remove(mdev);

carrier_mod = mdev->dev.parent->driver->owner;
module_put(carrier_mod);

put_device(&mdev->dev);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mei/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static void mei_cl_wake_all(struct mei_cl *cl)
/* synchronized under device mutex */
if (waitqueue_active(&cl->wait)) {
cl_dbg(dev, cl, "Waking up ctrl write clients!\n");
wake_up_interruptible(&cl->wait);
wake_up(&cl->wait);
}
}

Expand Down

0 comments on commit 07b5ca2

Please sign in to comment.