Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337209
b: refs/heads/master
c: 5c092f4
h: refs/heads/master
i:
  337207: 3a8c763
v: v3
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent 52c1bbe commit a782206
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ee60a7038c79d2276ae315ac6d6764391ed386f
refs/heads/master: 5c092f41fdb636859a20f57372f8dd25633adbef
28 changes: 17 additions & 11 deletions trunk/drivers/staging/ced1401/ced_ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,18 +913,24 @@ int GetTransfer(DEVICE_EXTENSION * pdx, TGET_TX_BLOCK __user * pTX)
iReturn = U14ERR_BADAREA;
else {
// Return the best information we have - we don't have physical addresses
TGET_TX_BLOCK tx;
memset(&tx, 0, sizeof(tx)); // clean out local work structure
tx.size = pdx->rTransDef[dwIdent].dwLength;
tx.linear = (long long)((long)pdx->rTransDef[dwIdent].lpvBuff);
tx.avail = GET_TX_MAXENTRIES; // how many blocks we could return
tx.used = 1; // number we actually return
tx.entries[0].physical =
(long long)(tx.linear + pdx->StagedOffset);
tx.entries[0].size = tx.size;

if (copy_to_user(pTX, &tx, sizeof(tx)))
TGET_TX_BLOCK *tx;

tx = kzalloc(sizeof(*tx), GFP_KERNEL);
if (!tx) {
mutex_unlock(&pdx->io_mutex);
return -ENOMEM;
}
tx->size = pdx->rTransDef[dwIdent].dwLength;
tx->linear = (long long)((long)pdx->rTransDef[dwIdent].lpvBuff);
tx->avail = GET_TX_MAXENTRIES; // how many blocks we could return
tx->used = 1; // number we actually return
tx->entries[0].physical =
(long long)(tx->linear + pdx->StagedOffset);
tx->entries[0].size = tx->size;

if (copy_to_user(pTX, tx, sizeof(*tx)))
iReturn = -EFAULT;
kfree(tx);
}
mutex_unlock(&pdx->io_mutex);
return iReturn;
Expand Down

0 comments on commit a782206

Please sign in to comment.