Changeset 3438
- Timestamp:
- 01/24/00 22:41:19 (13 years ago)
- Location:
- i2c/trunk/kernel
- Files:
-
- 2 modified
-
i2c-core.c (modified) (1 diff)
-
i2c-dev.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c/trunk/kernel/i2c-core.c
r3436 r3438 500 500 if (len < 0) 501 501 len = 0; 502 copy_to_user (buf,kbuf+file->f_pos,len); 502 if (copy_to_user (buf,kbuf+file->f_pos, 503 len)) { 504 kfree(kbuf); 505 return -EFAULT; 506 } 503 507 file->f_pos += len; 504 508 kfree(kbuf); -
i2c/trunk/kernel/i2c-dev.c
r3437 r3438 149 149 ret = i2c_master_recv(client,tmp,count); 150 150 if (! ret) 151 copy_to_user(buf,tmp,count);151 ret = copy_to_user(buf,tmp,count)?-EFAULT:0; 152 152 kfree(tmp); 153 153 return ret; … … 169 169 if (tmp==NULL) 170 170 return -ENOMEM; 171 copy_from_user(tmp,buf,count); 171 if (copy_from_user(tmp,buf,count)) { 172 kfree(tmp); 173 return -EFAULT; 174 } 172 175 173 176 #ifdef DEBUG
