Fix typo in copy_to_user calls

We want to copy to card_res->modes + copied, not &card_res->modes + copied.
main
Jesse Barnes 2007-11-16 13:57:42 -08:00
parent 7ec4ebe95e
commit 96e136c479
1 changed files with 4 additions and 5 deletions

View File

@ -1209,8 +1209,7 @@ int drm_mode_getresources(struct drm_device *dev,
list_for_each_entry(output, &dev->mode_config.output_list,
head) {
DRM_DEBUG("OUTPUT ID is %d\n", output->id);
if (put_user(output->id,
card_res->output_id + copied))
if (put_user(output->id, card_res->output_id + copied))
return -EFAULT;
copied++;
}
@ -1224,7 +1223,7 @@ int drm_mode_getresources(struct drm_device *dev,
head) {
list_for_each_entry(mode, &output->modes, head) {
drm_crtc_convert_to_umode(&u_mode, mode);
if (copy_to_user(&card_res->modes + copied,
if (copy_to_user(card_res->modes + copied,
&u_mode, sizeof(u_mode)))
return -EFAULT;
copied++;
@ -1233,9 +1232,9 @@ int drm_mode_getresources(struct drm_device *dev,
/* add in user modes */
list_for_each_entry(mode, &dev->mode_config.usermode_list, head) {
drm_crtc_convert_to_umode(&u_mode, mode);
if (copy_to_user(&card_res->modes + copied, &u_mode,
if (copy_to_user(card_res->modes + copied, &u_mode,
sizeof(u_mode)))
return -EFAULT;
return -EFAULT;
copied++;
}
}