aboutsummaryrefslogtreecommitdiffstats
path: root/block/scsi_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r--block/scsi_ioctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 65c6a3cba6d6..e83f1dbf7c29 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -78,7 +78,9 @@ static int sg_set_timeout(request_queue_t *q, int __user *p)
78 78
79static int sg_get_reserved_size(request_queue_t *q, int __user *p) 79static int sg_get_reserved_size(request_queue_t *q, int __user *p)
80{ 80{
81 return put_user(q->sg_reserved_size, p); 81 unsigned val = min(q->sg_reserved_size, q->max_sectors << 9);
82
83 return put_user(val, p);
82} 84}
83 85
84static int sg_set_reserved_size(request_queue_t *q, int __user *p) 86static int sg_set_reserved_size(request_queue_t *q, int __user *p)