Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -4
+4 -4
drivers/firmware/arm_scmi/driver.c
··· 654 654 655 655 static int scmi_mailbox_check(struct device_node *np) 656 656 { 657 - struct of_phandle_args arg; 658 - 659 - return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, &arg); 657 + return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, NULL); 660 658 } 661 659 662 660 static int scmi_mbox_free_channel(int id, void *p, void *data) ··· 796 798 return -EINVAL; 797 799 } 798 800 799 - desc = of_match_device(scmi_of_match, dev)->data; 801 + desc = of_device_get_match_data(dev); 802 + if (!desc) 803 + return -EINVAL; 800 804 801 805 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); 802 806 if (!info)