diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 23:13:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 23:13:55 +0100 |
commit | 3c7dc6a079182bdab5ff7a66307bd63c2be837eb (patch) | |
tree | 265a5a72c97177b2e8b18d0a62601dab5f380b70 /drivers/usb | |
parent | Linux 4.5-rc4 (diff) | |
parent | usb: chipidea: fix return value check in ci_hdrc_pci_probe() (diff) | |
download | linux-3c7dc6a079182bdab5ff7a66307bd63c2be837eb.tar.xz linux-3c7dc6a079182bdab5ff7a66307bd63c2be837eb.zip |
Merge tag 'usb-ci-v4.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-linus
Peter writes:
Some tiny bug fixes for chipidea driver
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/chipidea/debug.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c index b59195edf636..b635ab67490d 100644 --- a/drivers/usb/chipidea/ci_hdrc_pci.c +++ b/drivers/usb/chipidea/ci_hdrc_pci.c @@ -85,8 +85,8 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev, /* register a nop PHY */ ci->phy = usb_phy_generic_register(); - if (!ci->phy) - return -ENOMEM; + if (IS_ERR(ci->phy)) + return PTR_ERR(ci->phy); memset(res, 0, sizeof(res)); res[0].start = pci_resource_start(pdev, 0); diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index a4f7db2e18dd..df47110bad2d 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -100,6 +100,9 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf, if (sscanf(buf, "%u", &mode) != 1) return -EINVAL; + if (mode > 255) + return -EBADRQC; + pm_runtime_get_sync(ci->dev); spin_lock_irqsave(&ci->lock, flags); ret = hw_port_test_set(ci, mode); |