[Linux1394-cvslog] rev 651 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dde...@li...> - 2002-10-28 23:01:51
|
Author: ddennedy Date: 2002-10-28 18:01:40 -0500 (Mon, 28 Oct 2002) New Revision: 651 Modified: trunk/raw1394.c Log: fix broken quadlet async write Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-10-28 18:01:41.000000000 -0500 @@ -656,19 +656,33 @@ break; - case RAW1394_REQ_ASYNC_WRITE: + case RAW1394_REQ_ASYNC_WRITE: DBGMSG("write_request called"); - packet = hpsb_make_writepacket(fi->host, node, addr, NULL, - req->req.length); - if (!packet) - return -ENOMEM; - - if (copy_from_user(packet->data, int2ptr(req->req.sendb), - req->req.length)) + if (req->req.length == 4) { + quadlet_t x; + + if (copy_from_user(&x, int2ptr(req->req.sendb), + req->req.length)) req->req.error = RAW1394_ERROR_MEMFAULT; + + packet = hpsb_make_writepacket(fi->host, node, addr, &x, + req->req.length); + if (!packet) + return -ENOMEM; + + } else { + packet = hpsb_make_writepacket(fi->host, node, addr, NULL, + req->req.length); + if (!packet) + return -ENOMEM; - req->req.length = 0; - break; + if (copy_from_user(packet->data, int2ptr(req->req.sendb), + req->req.length)) + req->req.error = RAW1394_ERROR_MEMFAULT; + } + + req->req.length = 0; + break; case RAW1394_REQ_LOCK: DBGMSG("lock_request called"); |