aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2019-04-28 23:11:24 -0700
committerOlof Johansson <olof@lixom.net>2019-04-28 23:11:24 -0700
commit7f26bb130a9469328eff6176ca70004ead3e5eac (patch)
treeacdeadf4ea655a115b9ffda0d7c5e3a13e763e29 /drivers/firmware
parentb94d3ff97e2ce2ce6d63f526ed53e299d0861e86 (diff)
parentd9350f21e5fe2614e1f78ef20c3a3e83c4a36391 (diff)
Merge tag 'scmi-fixes-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers
ARM SCMI fixes/cleanup for v5.2 1. Fix for of_node reference leak in scmi_mailbox_check by passing NULL argument to of_parse_phandle_with_args instead of dummy argument 2. Cleanup of_match_device->data NULL pointer handling using of_device_get_match_data() helper * tag 'scmi-fixes-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: replace of_match_device->data with of_device_get_match_data() firmware: arm_scmi: fix of_node leak in scmi_mailbox_check Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/arm_scmi/driver.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 8f952f2f1a29..b5bc4c7a8fab 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -654,9 +654,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)
static int scmi_mailbox_check(struct device_node *np)
{
- struct of_phandle_args arg;
-
- return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, &arg);
+ return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, NULL);
}
static int scmi_mbox_free_channel(int id, void *p, void *data)
@@ -798,7 +796,9 @@ static int scmi_probe(struct platform_device *pdev)
return -EINVAL;
}
- desc = of_match_device(scmi_of_match, dev)->data;
+ desc = of_device_get_match_data(dev);
+ if (!desc)
+ return -EINVAL;
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)