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.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmm5AhYACgkQAEG6vDF+
4piujBAArYDyXqWBvUnPPmqkFi+ogA7jxdWTydTTZmdUWvV4XIS1SCiet0SJtoQk
KexNPSTzR/dMrNR5NxO5bhsuSyDFM8InvZ13N4MInoQNVHmDJmFXNp9NyjwBtOOi
8J00E8SeLKFX139j1ZQy/znwSqDpu/u9cMwBH/77U2g3T1+3v4ntTEKe9sSqxsGR
0untPPLgVJOxvz6SN+V2xmqPmj5Bk+RadEtTUMgs/Y20pqeyHgG1jT6wEpwMQ8vD
abvi/JadzCo9W0R0UlK2iuVfIiUDwrVUvK7hxsQcYFRIIq4fPTp4xdnLVe6VuQ5y
QiT2j8B6ckQ2UkggqrGsjt0wsmH5fr183ZnSRuLpwI0ZFzYA8v3WqcYKADK0iRXa
WkqyjwlVXHh+hikjpEStS56jlOUlXnhyCnaw4zxHOpFRqhACd9AQARFCGlJWvbqa
Imv0P7dV3kNF/rBY4qjFl6pUyzz6SUjGBX3rTarSgZQ8zFH99k68wJYzNPXbmOFt
U4ORctpK95ryb76EKPlCXrQbfZplTD1PYHxxaWvpYnKS7qNisuil41exRrxqNHOj
+Z9E/ieLW2Gp9pNEGPV+2OFAwGcZeNE8pznYOqPU/v9mKObh9/+Fpgv4FwyQN/v9
0Xh0Cyn986slTBqTEJmbluf0XKjeZY0fsw3OaHOJOwW2FNsNiks=
=BxTR
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmm6o18ACgkQmmx57+YA
GNm7ew/+Mf6J/UeVQGTeRNqZ64WMz49cWzY1zmFvaPKzN2xwhTzg3ROrhc3rmOy3
ym6aBwAsfafEwyvJDt1Y8KxnpkLHkbmy413cw+uX0IcE2DbsYEMarScslvtTLY/5
g/+6N68fR4WHHcMTaqxuW79qrSuekFaWncXczexzeJFz36Brn0iHQLht8z2rjTjD
ARQj/daQBi22/BsarUQkYwitsJdwz58/Tcn2bP9TKtSWTlrI8iTaT+3U3M3M46gM
CBCCmcYihoyejy9D2yogNQ7XQn/I0r4eJgqSJF3AOP8o1bEJZb8SG/3+5XcegvlA
X+srpSlaYjrfK5CuCKZB64sfQ9nD0WvIqztR3b2MYmLpb1hcqyqr7QXH0pbzN9wL
LqPINWdTsw080FLH01TRpN4eu/oo0kbFzqpqRoWoJ4WV93WQbczYl7D2ZHNNlcwM
Mgj8ZoLQNpmYM68MTNflvQKqKLQI9XYgeAI5pLYwVsHWIWn76IBNboetIzyWyaq2
7JaNaJZ+TL6dN9ykFh8HT9hEVzWRwRT+hxgUEjcj2gH2EqWjvuH+3FSS2dLdC+0E
IfxDQwFOjc2wk8PxGFtqE6eaTXkVV+gR175xuoe3q/VTnnA4oETqs6TaZ/BWpZvk
mTv5Gy4bF04SPlclpiFMdXB18pw/cNNa7a68AV/KlppvcvZM/pE=
=kFM7
-----END PGP SIGNATURE-----
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>
This commit is contained in:
commit
df3ef89d7e
|
|
@ -1066,7 +1066,7 @@ static int scmi_register_event_handler(struct scmi_notify_instance *ni,
|
|||
* since at creation time we usually want to have all setup and ready before
|
||||
* events really start flowing.
|
||||
*
|
||||
* Return: A properly refcounted handler on Success, NULL on Failure
|
||||
* Return: A properly refcounted handler on Success, ERR_PTR on Failure
|
||||
*/
|
||||
static inline struct scmi_event_handler *
|
||||
__scmi_event_handler_get_ops(struct scmi_notify_instance *ni,
|
||||
|
|
@ -1113,7 +1113,7 @@ __scmi_event_handler_get_ops(struct scmi_notify_instance *ni,
|
|||
}
|
||||
mutex_unlock(&ni->pending_mtx);
|
||||
|
||||
return hndl;
|
||||
return hndl ?: ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static struct scmi_event_handler *
|
||||
|
|
|
|||
|
|
@ -189,13 +189,13 @@ struct scmi_protocol_handle {
|
|||
|
||||
/**
|
||||
* struct scmi_iterator_state - Iterator current state descriptor
|
||||
* @desc_index: Starting index for the current mulit-part request.
|
||||
* @desc_index: Starting index for the current multi-part request.
|
||||
* @num_returned: Number of returned items in the last multi-part reply.
|
||||
* @num_remaining: Number of remaining items in the multi-part message.
|
||||
* @max_resources: Maximum acceptable number of items, configured by the caller
|
||||
* depending on the underlying resources that it is querying.
|
||||
* @loop_idx: The iterator loop index in the current multi-part reply.
|
||||
* @rx_len: Size in bytes of the currenly processed message; it can be used by
|
||||
* @rx_len: Size in bytes of the currently processed message; it can be used by
|
||||
* the user of the iterator to verify a reply size.
|
||||
* @priv: Optional pointer to some additional state-related private data setup
|
||||
* by the caller during the iterations.
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/export.h>
|
||||
|
|
@ -940,13 +941,13 @@ static int scpi_probe(struct platform_device *pdev)
|
|||
int idx = scpi_drvinfo->num_chans;
|
||||
struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
|
||||
struct mbox_client *cl = &pchan->cl;
|
||||
struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
|
||||
struct device_node *shmem __free(device_node) =
|
||||
of_parse_phandle(np, "shmem", idx);
|
||||
|
||||
if (!of_match_node(shmem_of_match, shmem))
|
||||
return -ENXIO;
|
||||
|
||||
ret = of_address_to_resource(shmem, 0, &res);
|
||||
of_node_put(shmem);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to get SCPI payload mem resource\n");
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue