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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scmi-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes

Arm SCMI fixes for v7.0

Few fixes to:
1. Address a NULL dereference in the SCMI notify error path by ensurin
__scmi_event_handler_get_ops() consistently returns an ERR_PTR on
failure, as expected by callers.
2. Fix a device_node reference leak in the SCPI probe path by introducing
scope-based cleanup for acquired DT nodes.
3. Correct minor spelling errors.

* tag 'scmi-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
firmware: arm_scmi: Spelling s/mulit/multi/, s/currenly/currently/
firmware: arm_scmi: Fix NULL dereference on notify error path
firmware: arm_scpi: Fix device_node reference leak in probe path

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+7 -6
+2 -2
drivers/firmware/arm_scmi/notify.c
··· 1066 1066 * since at creation time we usually want to have all setup and ready before 1067 1067 * events really start flowing. 1068 1068 * 1069 - * Return: A properly refcounted handler on Success, NULL on Failure 1069 + * Return: A properly refcounted handler on Success, ERR_PTR on Failure 1070 1070 */ 1071 1071 static inline struct scmi_event_handler * 1072 1072 __scmi_event_handler_get_ops(struct scmi_notify_instance *ni, ··· 1113 1113 } 1114 1114 mutex_unlock(&ni->pending_mtx); 1115 1115 1116 - return hndl; 1116 + return hndl ?: ERR_PTR(-ENODEV); 1117 1117 } 1118 1118 1119 1119 static struct scmi_event_handler *
+2 -2
drivers/firmware/arm_scmi/protocols.h
··· 189 189 190 190 /** 191 191 * struct scmi_iterator_state - Iterator current state descriptor 192 - * @desc_index: Starting index for the current mulit-part request. 192 + * @desc_index: Starting index for the current multi-part request. 193 193 * @num_returned: Number of returned items in the last multi-part reply. 194 194 * @num_remaining: Number of remaining items in the multi-part message. 195 195 * @max_resources: Maximum acceptable number of items, configured by the caller 196 196 * depending on the underlying resources that it is querying. 197 197 * @loop_idx: The iterator loop index in the current multi-part reply. 198 - * @rx_len: Size in bytes of the currenly processed message; it can be used by 198 + * @rx_len: Size in bytes of the currently processed message; it can be used by 199 199 * the user of the iterator to verify a reply size. 200 200 * @priv: Optional pointer to some additional state-related private data setup 201 201 * by the caller during the iterations.
+3 -2
drivers/firmware/arm_scpi.c
··· 18 18 19 19 #include <linux/bitmap.h> 20 20 #include <linux/bitfield.h> 21 + #include <linux/cleanup.h> 21 22 #include <linux/device.h> 22 23 #include <linux/err.h> 23 24 #include <linux/export.h> ··· 941 940 int idx = scpi_drvinfo->num_chans; 942 941 struct scpi_chan *pchan = scpi_drvinfo->channels + idx; 943 942 struct mbox_client *cl = &pchan->cl; 944 - struct device_node *shmem = of_parse_phandle(np, "shmem", idx); 943 + struct device_node *shmem __free(device_node) = 944 + of_parse_phandle(np, "shmem", idx); 945 945 946 946 if (!of_match_node(shmem_of_match, shmem)) 947 947 return -ENXIO; 948 948 949 949 ret = of_address_to_resource(shmem, 0, &res); 950 - of_node_put(shmem); 951 950 if (ret) { 952 951 dev_err(dev, "failed to get SCPI payload mem resource\n"); 953 952 return ret;