summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy_ioctl.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:25 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:25 +0200
commit41fa9f863baacd32dd049daf8050d55a0c9e6f1a (patch)
tree44cc612753746cd459e122f102c72f33b36aa6b7 /drivers/ide/ide-floppy_ioctl.c
parentb5479167f4206e0d821a51ae149d921cd7a58e54 (diff)
downloadop-kernel-dev-41fa9f863baacd32dd049daf8050d55a0c9e6f1a.zip
op-kernel-dev-41fa9f863baacd32dd049daf8050d55a0c9e6f1a.tar.gz
ide: decrease size of ->pc_buf field in struct ide_atapi_pc
struct ide_atapi_pc is often allocated on the stack and size of ->pc_buf size is 256 bytes. However since only ide_floppy_create_read_capacity_cmd() and idetape_create_inquiry_cmd() require such size allocate buffers for these pc-s explicitely and decrease ->pc_buf size to 64 bytes. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy_ioctl.c')
-rw-r--r--drivers/ide/ide-floppy_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index 8f8be85..cd8a420 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -36,9 +36,9 @@ static int ide_floppy_get_format_capacities(ide_drive_t *drive,
int __user *arg)
{
struct ide_disk_obj *floppy = drive->driver_data;
- u8 header_len, desc_cnt;
int i, blocks, length, u_array_size, u_index;
int __user *argp;
+ u8 pc_buf[256], header_len, desc_cnt;
if (get_user(u_array_size, arg))
return -EFAULT;
@@ -47,6 +47,9 @@ static int ide_floppy_get_format_capacities(ide_drive_t *drive,
return -EINVAL;
ide_floppy_create_read_capacity_cmd(pc);
+ pc->buf = &pc_buf[0];
+ pc->buf_size = sizeof(pc_buf);
+
if (ide_queue_pc_tail(drive, floppy->disk, pc)) {
printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n");
return -EIO;
OpenPOWER on IntegriCloud