public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/media/video/v4l2-compat-ioctl32.c: Check the return value of copy_to_user
@ 2010-12-21  1:18 Thiago Farina
  2010-12-21 18:25 ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Thiago Farina @ 2010-12-21  1:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thiago Farina, Guennadi Liakhovetski, Mauro Carvalho Chehab,
	linux-media

This fix the following warning:
drivers/media/video/v4l2-compat-ioctl32.c: In function ‘get_microcode32’:
drivers/media/video/v4l2-compat-ioctl32.c:209: warning: ignoring return value of ‘copy_to_user’, declared with attribute warn_unused_result

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 drivers/media/video/v4l2-compat-ioctl32.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index e30e8df..55825ec 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -206,7 +206,9 @@ static struct video_code __user *get_microcode32(struct video_code32 *kp)
 	 * user address is invalid, the native ioctl will do
 	 * the error handling for us
 	 */
-	(void) copy_to_user(up->loadwhat, kp->loadwhat, sizeof(up->loadwhat));
+	if (copy_to_user(up->loadwhat, kp->loadwhat, sizeof(up->loadwhat)))
+		return NULL;
+
 	(void) put_user(kp->datasize, &up->datasize);
 	(void) put_user(compat_ptr(kp->data), &up->data);
 	return up;
-- 
1.7.3.2.343.g7d43d


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

end of thread, other threads:[~2010-12-22 15:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21  1:18 [PATCH] drivers/media/video/v4l2-compat-ioctl32.c: Check the return value of copy_to_user Thiago Farina
2010-12-21 18:25 ` Arnd Bergmann
2010-12-21 18:34   ` Thiago Farina
2010-12-21 19:03     ` Arnd Bergmann
2010-12-21 23:48       ` [PATCH v2] " Thiago Farina
2010-12-22 14:14         ` Andreas Oberritter
2010-12-22 15:50           ` Arnd Bergmann
2010-12-21 23:55     ` [PATCH] " Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox