[patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test

linux

[patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test

Postby Benoit Boissinot » Mon, 16 Jan 2006 08:00:21 GMT

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.


Signed-off-by: Benoit Boissinot < XXXX@XXXXX.COM >

diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
--- a/linux/drivers/cdrom/cdrom.c	2006-01-14 16:11:43.000000000 +0100
+++ b/drivers/cdrom/cdrom.c	2006-01-14 23:44:51.000000000 +0100
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test

Postby Benoit Boissinot » Mon, 16 Jan 2006 08:10:12 GMT



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.

Signed-off-by: Benoit Boissinot < XXXX@XXXXX.COM >

diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
--- a/drivers/cdrom/cdrom.c	2006-01-14 16:11:43.000000000 +0100
+++ b/drivers/cdrom/cdrom.c	2006-01-14 23:44:51.000000000 +0100
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test

Postby Jens Axboe » Tue, 17 Jan 2006 17:50:14 GMT





Good catch, thanks!

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 



Return to linux

 

Who is online

Users browsing this forum: No registered users and 60 guest