From: domen@coderock.org
To: B.Zolnierkiewicz@elka.pw.edu.pl
Cc: linux-ide@vger.kernel.org, domen@coderock.org, yrgrknmxpzlk@gawab.com
Subject: [patch 5/6] drivers/ide/* - compile warning cleanup
Date: Sun, 06 Mar 2005 11:42:17 +0100 [thread overview]
Message-ID: <20050306104217.8389C1F1F0@trashy.coderock.org> (raw)
compile warning cleanup - handle copy_to/from_user error returns
Signed-off-by: Stephen Biggs <yrgrknmxpzlk@gawab.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
kj-domen/drivers/ide/ide-tape.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff -puN drivers/ide/ide-tape.c~return_code-drivers_ide drivers/ide/ide-tape.c
--- kj/drivers/ide/ide-tape.c~return_code-drivers_ide 2005-03-05 16:13:05.000000000 +0100
+++ kj-domen/drivers/ide/ide-tape.c 2005-03-05 16:13:05.000000000 +0100
@@ -2610,7 +2610,13 @@ static void idetape_copy_stage_from_user
}
#endif /* IDETAPE_DEBUG_BUGS */
count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
- copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
+ if (copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count)) {
+#if IDETAPE_DEBUG_BUGS
+ printk(KERN_ERR "ide-tape/%s: copy_from_user failed!\n",
+ __FUNCTION__);
+#endif /* IDETAPE_DEBUG_BUGS */
+ return;
+ }
n -= count;
atomic_add(count, &bh->b_count);
buf += count;
@@ -2637,7 +2643,12 @@ static void idetape_copy_stage_to_user (
}
#endif /* IDETAPE_DEBUG_BUGS */
count = min(tape->b_count, n);
- copy_to_user(buf, tape->b_data, count);
+ if (copy_to_user(buf, tape->b_data, count)) {
+#if IDETAPE_DEBUG_BUGS
+ printk(KERN_ERR "ide-tape/%s: copy_to_user failed!\n",__FUNCTION__);
+#endif /* IDETAPE_DEBUG_BUGS */
+ return;
+ }
n -= count;
tape->b_data += count;
tape->b_count -= count;
_
next reply other threads:[~2005-03-06 10:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-06 10:42 domen [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-06-20 21:52 [patch 5/6] drivers/ide/* - compile warning cleanup domen
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=20050306104217.8389C1F1F0@trashy.coderock.org \
--to=domen@coderock.org \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=linux-ide@vger.kernel.org \
--cc=yrgrknmxpzlk@gawab.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).