Skip to contentSkip to conversation

telephony: fix return value

PATCH Applied Nicolas Kaiser 2 participants 2 messages Oct 26, 2010 – Oct 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 telephony: fix return value

If copy_from_user fails, the return value gets overwritten.

---
 drivers/telephony/ixj.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/telephony/ixj.c +2 -1
index 0d236f4..2d1280a 100644
@@ -6581,7 +6581,8 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
 	case IXJCTL_SET_FILTER:
 		if (copy_from_user(&jf, argp, sizeof(jf))) 
 			retval = -EFAULT;
-		retval = ixj_init_filter(j, &jf);
+		else
+			retval = ixj_init_filter(j, &jf);
 		break;
 	case IXJCTL_SET_FILTER_RAW:
 		if (copy_from_user(&jfr, argp, sizeof(jfr))) 
Signature · 1 line
1.7.2.2
Applied
#1 lore raw
Quoted 12 lines · Nicolas Kaiser

If copy_from_user fails, the return value gets overwritten.

---
 drivers/telephony/ixj.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/telephony/ixj.c +0 -0
index 0d236f4..2d1280a 100644

drivers/telephony/ixj.c static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar · line 6588

Quoted 9 lines
drivers/telephony/ixj.c +2 -1
@@ -6581,7 +6581,8 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
 	case IXJCTL_SET_FILTER:
 		if (copy_from_user(&jf, argp, sizeof(jf))) 
 			retval = -EFAULT;
-		retval = ixj_init_filter(j, &jf);
+		else
+			retval = ixj_init_filter(j, &jf);
 		break;
 	case IXJCTL_SET_FILTER_RAW:
 		if (copy_from_user(&jfr, argp, sizeof(jfr))) 

Applied, thanks Nicolas.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.