All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][MIPS] add return value check to user_termio_to_kernel_termios()
@ 2009-01-25 13:45 Yoichi Yuasa
  2009-01-28 12:40 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Yoichi Yuasa @ 2009-01-25 13:45 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: yoichi_yuasa, linux-mips


Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/include/asm/termios.h linux/arch/mips/include/asm/termios.h
--- linux-orig/arch/mips/include/asm/termios.h	2008-10-19 22:33:14.114377349 +0900
+++ linux/arch/mips/include/asm/termios.h	2008-10-19 22:41:25.322369698 +0900
@@ -97,14 +97,14 @@ struct termio {
 #define user_termio_to_kernel_termios(termios, termio) \
 ({ \
 	unsigned short tmp; \
-	get_user(tmp, &(termio)->c_iflag); \
-	(termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
-	get_user(tmp, &(termio)->c_oflag); \
-	(termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
-	get_user(tmp, &(termio)->c_cflag); \
-	(termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
-	get_user(tmp, &(termio)->c_lflag); \
-	(termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
+	if (!get_user(tmp, &(termio)->c_iflag)) \
+		(termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
+	if (!get_user(tmp, &(termio)->c_oflag)) \
+		(termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
+	if (!get_user(tmp, &(termio)->c_cflag)) \
+		(termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
+	if (!get_user(tmp, &(termio)->c_lflag)) \
+		(termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
 	get_user((termios)->c_line, &(termio)->c_line); \
 	copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
 })

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-29 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-25 13:45 [PATCH][MIPS] add return value check to user_termio_to_kernel_termios() Yoichi Yuasa
2009-01-28 12:40 ` Ralf Baechle
2009-01-28 13:40   ` Ralf Baechle
2009-01-29 12:00     ` Yoichi Yuasa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.