Skip to contentSkip to conversation

drivers/cdrom/cdrom.c fix incorrect test

PATCH In review Benoit Boissinot 2 participants 3 messages Jan 14, 2006 – Jan 16, 2006 Uniform cdrom driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/cdrom/cdrom.c fix incorrect test

In cleanup-cdrom_ioctl.patch,

the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))

		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)

	return -EINVAL;

which is not equivalent with morgan's law.

drivers/cdrom/cdrom.c renamed from linux/drivers/cdrom/cdrom.c +1 -1
diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
@@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
 		return -EFAULT;
 
 	requested_format = entry.cdte_format;
-	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
+	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
 		return -EINVAL;
 	/* make interface to low-level uniform */
 	entry.cdte_format = CDROM_MSF;
#1 lore raw
Quoted 5 lines · Benoit Boissinot

In cleanup-cdrom_ioctl.patch,

the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))

Quoted 9 lines
		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)

	return -EINVAL;

which is not equivalent with morgan's law.

sorry, it doesn't apply with -p1 correct patch below:

In cleanup-cdrom_ioctl.patch,
the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))

		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)

	return -EINVAL;

which is not equivalent with morgan's law.

drivers/cdrom/cdrom.c +1 -1
diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
@@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
 		return -EFAULT;
 
 	requested_format = entry.cdte_format;
-	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
+	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
 		return -EINVAL;
 	/* make interface to low-level uniform */
 	entry.cdte_format = CDROM_MSF;
#2 lore raw
Quoted 36 lines · Benoit Boissinot
Quoted 5 lines · Benoit Boissinot

In cleanup-cdrom_ioctl.patch,

the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))

Quoted 9 lines
		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)

	return -EINVAL;

which is not equivalent with morgan's law.

sorry, it doesn't apply with -p1 correct patch below:

In cleanup-cdrom_ioctl.patch,
the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))

		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)

	return -EINVAL;

which is not equivalent with morgan's law.

diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c

drivers/cdrom/cdrom.c static int cdrom_ioctl_read_tocentry(str · line 2591

Quoted 8 lines
drivers/cdrom/cdrom.c +1 -1
@@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
 		return -EFAULT;
 
 	requested_format = entry.cdte_format;
-	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
+	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
 		return -EINVAL;
 	/* make interface to low-level uniform */
 	entry.cdte_format = CDROM_MSF;

Good catch, thanks!

Signature · 1 line
Jens Axboe