firewire: cdev: address handler input validation
Like before my commit 1415d9189e
,
fw_core_add_address_handler() does not align the address region now.
Instead the caller is required to pass valid parameters.
Since one of the callers of fw_core_add_address_handler() is the cdev
userspace interface, we now check for valid input. If the client is
buggy, we give it a hint with -EINVAL.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
@@ -591,9 +591,10 @@ static int ioctl_allocate(struct client *client, void *buffer)
|
||||
handler->closure = request->closure;
|
||||
handler->client = client;
|
||||
|
||||
if (fw_core_add_address_handler(&handler->handler, ®ion) < 0) {
|
||||
ret = fw_core_add_address_handler(&handler->handler, ®ion);
|
||||
if (ret < 0) {
|
||||
kfree(handler);
|
||||
return -EBUSY;
|
||||
return ret;
|
||||
}
|
||||
|
||||
handler->resource.release = release_address_handler;
|
||||
|
Reference in New Issue
Block a user