Browse Source

telephony: fix return value

If copy_from_user fails, the return value gets overwritten.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Nicolas Kaiser 15 years ago
parent
commit
b0438a1b71
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/telephony/ixj.c

+ 2 - 1
drivers/telephony/ixj.c

@@ -6581,7 +6581,8 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
 	case IXJCTL_SET_FILTER:
 	case IXJCTL_SET_FILTER:
 		if (copy_from_user(&jf, argp, sizeof(jf))) 
 		if (copy_from_user(&jf, argp, sizeof(jf))) 
 			retval = -EFAULT;
 			retval = -EFAULT;
-		retval = ixj_init_filter(j, &jf);
+		else
+			retval = ixj_init_filter(j, &jf);
 		break;
 		break;
 	case IXJCTL_SET_FILTER_RAW:
 	case IXJCTL_SET_FILTER_RAW:
 		if (copy_from_user(&jfr, argp, sizeof(jfr))) 
 		if (copy_from_user(&jfr, argp, sizeof(jfr)))