A minor bug in sr_ioctl.c for 2.1.13?

tenthumbs@cybernex.net
Mon, 25 Nov 1996 19:56:36 GMT


Whenever I mount a cdrom with 2.1.13 I get this message:

DEBUG: sr_audio: result for ioctl 5305: fffffff2

which is saying that the code for CDROMREADTOCHDR returned
-EFAULT.

This is coming from the sr_audio_ioctl function in sr_ioctl.c
where it says:

if (copy_to_user(...))
return -EFAULT;

Shouldn't this be
if (!copy_to_user(...))

If I'm right, here's a simple patch.

==================
--- sr_ioctl.c.orig Sat Nov 23 16:51:25 1996
+++ sr_ioctl.c Mon Nov 25 14:19:24 1996
@@ -339,7 +339,7 @@

scsi_free(buffer, 512);

- if (copy_to_user ((void *) arg, &tochdr, sizeof (struct cdrom_tochdr)))
+ if (!copy_to_user ((void *) arg, &tochdr, sizeof (struct cdrom_tochdr)))
result = -EFAULT;
break;
}
==================