提交 97eba326 编写于 作者: W Wei Yongjun 提交者: Greg Kroah-Hartman

usb: roles: Fix return value check in intel_xhci_usb_probe()

In case of error, the function devm_ioremap_nocache() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Fixes: f6fb9ec0 ("usb: roles: Add Intel xHCI USB role switch driver")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7fafcfdf
......@@ -145,8 +145,8 @@ static int intel_xhci_usb_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
data->base = devm_ioremap_nocache(dev, res->start, resource_size(res));
if (IS_ERR(data->base))
return PTR_ERR(data->base);
if (!data->base)
return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(allow_userspace_ctrl_ids); i++)
if (acpi_dev_present(allow_userspace_ctrl_ids[i].hid, "1",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册