From: domen@coderock.org
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, isdn4linux@listserv.isdn4linux.de,
domen@coderock.org, yrgrknmxpzlk@gawab.com
Subject: [patch 6/8] drivers/isdn/hisax/* - compile warning cleanup
Date: Sun, 06 Mar 2005 23:38:15 +0100 [thread overview]
Message-ID: <20050306223816.667791EFA4@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/isdn/hisax/config.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff -puN drivers/isdn/hisax/config.c~return_code-drivers_isdn_hisax drivers/isdn/hisax/config.c
--- kj/drivers/isdn/hisax/config.c~return_code-drivers_isdn_hisax 2005-03-05 16:13:06.000000000 +0100
+++ kj-domen/drivers/isdn/hisax/config.c 2005-03-05 16:13:06.000000000 +0100
@@ -631,7 +631,12 @@ int HiSax_readstatus(u_char __user *buf,
count = cs->status_end - cs->status_read + 1;
if (count >= len)
count = len;
- copy_to_user(p, cs->status_read, count);
+ if (copy_to_user(p, cs->status_read, count)) {
+ printk(KERN_ERR
+ "HiSax:%s: copy_to_user failed!\n",
+ __FUNCTION__);
+ return -EFAULT;
+ }
cs->status_read += count;
if (cs->status_read > cs->status_end)
cs->status_read = cs->status_buf;
@@ -642,7 +647,12 @@ int HiSax_readstatus(u_char __user *buf,
cnt = HISAX_STATUS_BUFSIZE;
else
cnt = count;
- copy_to_user(p, cs->status_read, cnt);
+ if (copy_to_user(p, cs->status_read, cnt)) {
+ printk(KERN_ERR
+ "HiSax:%s: copy_to_user failed!\n",
+ __FUNCTION__);
+ return -EFAULT;
+ }
p += cnt;
cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
count -= cnt;
_
reply other threads:[~2005-03-06 22:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050306223816.667791EFA4@trashy.coderock.org \
--to=domen@coderock.org \
--cc=akpm@osdl.org \
--cc=isdn4linux@listserv.isdn4linux.de \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®