* [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c
@ 2007-01-20 7:10 Dirk Behme
2007-01-27 6:40 ` Dirk Behme
0 siblings, 1 reply; 3+ messages in thread
From: Dirk Behme @ 2007-01-20 7:10 UTC (permalink / raw)
To: linux-omap-open-source
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c
2007-01-20 7:10 [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c Dirk Behme
@ 2007-01-27 6:40 ` Dirk Behme
2007-01-27 17:58 ` tony
0 siblings, 1 reply; 3+ messages in thread
From: Dirk Behme @ 2007-01-27 6:40 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap-open-source
Dirk Behme wrote:
> ARM: OMAP: Fix warnings in musb_procfs.c:
What's about this one? Do I overlooked any comments?
It's the last one in my pending patches list ;)
Orginal post:
http://linux.omap.com/pipermail/linux-omap-open-source/2007-January/008903.html
> 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>
>
>
> ------------------------------------------------------------------------
>
> 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 == '-') {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-27 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-20 7:10 [PATCH] ARM: OMAP: Fix warnings in musb_procfs.c Dirk Behme
2007-01-27 6:40 ` Dirk Behme
2007-01-27 17:58 ` tony
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox