aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ced1401
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-10-22 17:22:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-23 20:35:54 -0700
commit5c092f41fdb636859a20f57372f8dd25633adbef (patch)
tree844d5be153769c203d4c4fd6e87bcb31bb6c66f2 /drivers/staging/ced1401
parent5ee60a7038c79d2276ae315ac6d6764391ed386f (diff)
staging: ced1401: fix a frame size warning
gcc/sparse complain about the following: drivers/staging/ced1401/ced_ioc.c:931:1: warning: the frame size of 4144 bytes is larger than 2048 bytes [-Wframe-larger-than=] Fix it by dynamically allocating it. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ced1401')
-rw-r--r--drivers/staging/ced1401/ced_ioc.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
index 5813aee6b34..0adba75be8b 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -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;