summaryrefslogtreecommitdiffstats
path: root/drivers/telephony/ixj.c
diff options
context:
space:
mode:
authorPaul Mundt2010-05-31 06:14:26 +0200
committerPaul Mundt2010-05-31 06:14:26 +0200
commitd5b732b17ca2fc74f370bdba5aae6c804fac8c35 (patch)
tree4facc6d96116b032a3c1cb2ced9b2a3008e9216e /drivers/telephony/ixj.c
parentARM: mach-shmobile: SH7372 has 6 SCIFA and 1 SCIFB ports (diff)
parentLinux 2.6.35-rc1 (diff)
downloadkernel-qcow2-linux-d5b732b17ca2fc74f370bdba5aae6c804fac8c35.tar.gz
kernel-qcow2-linux-d5b732b17ca2fc74f370bdba5aae6c804fac8c35.tar.xz
kernel-qcow2-linux-d5b732b17ca2fc74f370bdba5aae6c804fac8c35.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/telephony/ixj.c')
-rw-r--r--drivers/telephony/ixj.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index e89304c72568..b53deee25d74 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -5879,20 +5879,13 @@ out:
static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp)
{
IXJ_FILTER_CADENCE *lcp;
- lcp = kmalloc(sizeof(IXJ_FILTER_CADENCE), GFP_KERNEL);
- if (lcp == NULL) {
+ lcp = memdup_user(cp, sizeof(IXJ_FILTER_CADENCE));
+ if (IS_ERR(lcp)) {
if(ixjdebug & 0x0001) {
- printk(KERN_INFO "Could not allocate memory for cadence\n");
+ printk(KERN_INFO "Could not allocate memory for cadence or could not copy cadence to kernel\n");
}
- return -ENOMEM;
+ return PTR_ERR(lcp);
}
- if (copy_from_user(lcp, cp, sizeof(IXJ_FILTER_CADENCE))) {
- if(ixjdebug & 0x0001) {
- printk(KERN_INFO "Could not copy cadence to kernel\n");
- }
- kfree(lcp);
- return -EFAULT;
- }
if (lcp->filter > 5) {
if(ixjdebug & 0x0001) {
printk(KERN_INFO "Cadence out of range\n");