X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fisdn%2Fhisax%2Fconfig.c;fp=drivers%2Fisdn%2Fhisax%2Fconfig.c;h=9280b581fa00f6ad34049d37e3718a188a84504c;hb=7172c64a7cee4dfa95864f49c914f7ea8cf497c8;hp=e10350360f2ff27c5158fbebe732fa0991bf44bd;hpb=3967a72a825e44bff5d10f516e90b6f59f59e599;p=linux-2.6.git diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index e10350360..9280b581f 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) 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)) + return -EFAULT; cs->status_read += count; if (cs->status_read > cs->status_end) cs->status_read = cs->status_buf; @@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) cnt = HISAX_STATUS_BUFSIZE; else cnt = count; - copy_to_user(p, cs->status_read, cnt); + if (copy_to_user(p, cs->status_read, cnt)) + return -EFAULT; p += cnt; cs->status_read += cnt % HISAX_STATUS_BUFSIZE; count -= cnt;