Commit 66d5cab9 authored by Peter Osterlund's avatar Peter Osterlund Committed by Linus Torvalds

[PATCH] cdrom: buffer sizing fix

The problem is that some drives fail the "GET CONFIGURATION" command when
asked to only return 8 bytes.  This happens for example on my drive, which
is identified as:

        hdc: HL-DT-ST DVD+RW GCA-4040N, ATAPI CD/DVD-ROM drive

Since the cdrom_mmc3_profile() function already allocates 32 bytes for the
reply buffer, this patch is enough to make the command succeed on my drive.
Signed-off-by: default avatarPeter Osterlund <petero2@telia.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2f8e2dc8
......@@ -865,7 +865,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi)
cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
cgc.cmd[1] = 0;
cgc.cmd[2] = cgc.cmd[3] = 0; /* Starting Feature Number */
cgc.cmd[7] = 0; cgc.cmd [8] = 8; /* Allocation Length */
cgc.cmd[8] = sizeof(buffer); /* Allocation Length */
cgc.quiet = 1;
if ((ret = cdi->ops->generic_packet(cdi, &cgc))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment