Skip to content

Commit

Permalink
usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe
Browse files Browse the repository at this point in the history
The devm_memremap() function never returns NULL.  It returns error
pointers.

Fixes: cdc3d2a ("usb: typec: ucsi: acpi: Map the mailbox with memremap()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Dan Carpenter authored and Rafael J. Wysocki committed May 30, 2022
1 parent b941820 commit a9face8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/typec/ucsi/ucsi_acpi.c
Original file line number Diff line number Diff line change
@@ -133,8 +133,8 @@ static int ucsi_acpi_probe(struct platform_device *pdev)
}

ua->base = devm_memremap(&pdev->dev, res->start, resource_size(res), MEMREMAP_WB);
if (!ua->base)
return -ENOMEM;
if (IS_ERR(ua->base))
return PTR_ERR(ua->base);

ret = guid_parse(UCSI_DSM_UUID, &ua->guid);
if (ret)

0 comments on commit a9face8

Please sign in to comment.