All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c
Date: Sat, 20 Jan 2007 08:10:10 +0100	[thread overview]
Message-ID: <45B1C052.4020809@googlemail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]


ARM: OMAP: Fix warnings in musb_procfs.c:

drivers/usb/musb/musb_procfs.c: In function 'musb_proc_write':
drivers/usb/musb/musb_procfs.c:651: warning: ignoring return
value of 'copy_from_user', declared with attribute
warn_unused_result
drivers/usb/musb/musb_procfs.c:725: warning: ignoring return
value of 'copy_from_user', declared with attribute
warn_unused_result

Signed-off-by: Dirk Behme <dirk.behme_at_gmail.com>


[-- Attachment #2: musb_procfs_warning_fix --]
[-- Type: text/plain, Size: 801 bytes --]

Index: linux-osk/drivers/usb/musb/musb_procfs.c
===================================================================
--- linux-osk.orig/drivers/usb/musb/musb_procfs.c
+++ linux-osk/drivers/usb/musb/musb_procfs.c
@@ -648,7 +648,8 @@ static int musb_proc_write(struct file *
 
 	/* MOD_INC_USE_COUNT; */
 
-	copy_from_user(&cmd, buffer, 1);
+	if(unlikely(copy_from_user(&cmd, buffer, 1)))
+		return -EFAULT;
 	switch (cmd) {
 	case 'C':
 		if (pBase) {
@@ -722,7 +723,10 @@ static int musb_proc_write(struct file *
 				int i = 0, level = 0, sign = 1;
 				int len = min(count - 1, (unsigned long)8);
 
-				copy_from_user(&digits, &buffer[1], len);
+				if(unlikely(copy_from_user(&digits,
+							   &buffer[1],
+							   len)))
+					return -EFAULT;
 
 				/* optional sign */
 				if (*p == '-') {


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2007-01-20  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-20  7:10 Dirk Behme [this message]
2007-01-27  6:40 ` [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c Dirk Behme
2007-01-27 17:58   ` tony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B1C052.4020809@googlemail.com \
    --to=dirk.behme@googlemail.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.