aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-cdev.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-12-14 13:21:01 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-03-24 15:56:38 -0400
commit3e0b5f0d7cb5fef402517e41eebff5a0f0e65a13 (patch)
treeb712284afebff56dd2e104242f4e6665aaf6c8e4 /drivers/firewire/fw-cdev.c
parent45ee3199eb3e4233b755a9bb353a0527a4c58b5f (diff)
firewire: cdev: address handler input validation
Like before my commit 1415d9189e8c59aa9c77a3bba419dcea062c145f, 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>
Diffstat (limited to 'drivers/firewire/fw-cdev.c')
-rw-r--r--drivers/firewire/fw-cdev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 094aee5c8bcf..44af45205dcd 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -591,9 +591,10 @@ static int ioctl_allocate(struct client *client, void *buffer)
591 handler->closure = request->closure; 591 handler->closure = request->closure;
592 handler->client = client; 592 handler->client = client;
593 593
594 if (fw_core_add_address_handler(&handler->handler, &region) < 0) { 594 ret = fw_core_add_address_handler(&handler->handler, &region);
595 if (ret < 0) {
595 kfree(handler); 596 kfree(handler);
596 return -EBUSY; 597 return ret;
597 } 598 }
598 599
599 handler->resource.release = release_address_handler; 600 handler->resource.release = release_address_handler;