summaryrefslogtreecommitdiff
path: root/drivers/staging/ced1401/ced_ioc.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2013-01-11 09:01:39 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-12 00:44:10 (GMT)
commit955e7da82d8cc917a2c604c782b525dec3466921 (patch)
treee213d81f73c31d7883b9058b93ddf1572dd79a22 /drivers/staging/ced1401/ced_ioc.c
parentccbdccd4a7981c150a882123a577c11b2e808051 (diff)
downloadlinux-fsl-qoriq-955e7da82d8cc917a2c604c782b525dec3466921.tar.xz
staging: ced1401: fix GFP_KERNEL in spinlock context
Allowi() calls usb_submit_urb(pdx->pUrbCharIn, bInCallback ? GFP_ATOMIC : GFP_KERNEL) under spin_lock_irqsave(&pdx->charInLock, flags). That means it should use GFP_ATOMIC anyway. As soon as it is the only usage of bInCallback argument, the patch removes it at all. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ced1401/ced_ioc.c')
-rw-r--r--drivers/staging/ced1401/ced_ioc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
index d043471..82a333f 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -123,7 +123,7 @@ int SendString(DEVICE_EXTENSION * pdx, const char __user * pData,
iReturn = PutChars(pdx, buffer, n);
}
- Allowi(pdx, false); // make sure we have input int
+ Allowi(pdx); // make sure we have input int
mutex_unlock(&pdx->io_mutex);
return iReturn;
@@ -140,7 +140,7 @@ int SendChar(DEVICE_EXTENSION * pdx, char c)
mutex_lock(&pdx->io_mutex); // Protect disconnect from new i/o
iReturn = PutChars(pdx, &c, 1);
dev_dbg(&pdx->interface->dev, "SendChar >%c< (0x%02x)", c, c);
- Allowi(pdx, false); // Make sure char reads are running
+ Allowi(pdx); // Make sure char reads are running
mutex_unlock(&pdx->io_mutex);
return iReturn;
}
@@ -433,8 +433,8 @@ int GetChar(DEVICE_EXTENSION * pdx)
dev_dbg(&pdx->interface->dev, "GetChar");
- Allowi(pdx, false); // Make sure char reads are running
- SendChars(pdx); // and send any buffered chars
+ Allowi(pdx); // Make sure char reads are running
+ SendChars(pdx); // and send any buffered chars
spin_lock_irq(&pdx->charInLock);
if (pdx->dwNumInput > 0) // worth looking
@@ -447,7 +447,7 @@ int GetChar(DEVICE_EXTENSION * pdx)
iReturn = U14ERR_NOIN; // no input data to read
spin_unlock_irq(&pdx->charInLock);
- Allowi(pdx, false); // Make sure char reads are running
+ Allowi(pdx); // Make sure char reads are running
mutex_unlock(&pdx->io_mutex); // Protect disconnect from new i/o
return iReturn;
@@ -472,7 +472,7 @@ int GetString(DEVICE_EXTENSION * pdx, char __user * pUser, int n)
return -ENOMEM;
mutex_lock(&pdx->io_mutex); // Protect disconnect from new i/o
- Allowi(pdx, false); // Make sure char reads are running
+ Allowi(pdx); // Make sure char reads are running
SendChars(pdx); // and send any buffered chars
spin_lock_irq(&pdx->charInLock);
@@ -518,7 +518,7 @@ int GetString(DEVICE_EXTENSION * pdx, char __user * pUser, int n)
} else
spin_unlock_irq(&pdx->charInLock);
- Allowi(pdx, false); // Make sure char reads are running
+ Allowi(pdx); // Make sure char reads are running
mutex_unlock(&pdx->io_mutex); // Protect disconnect from new i/o
return iReturn;
@@ -531,7 +531,7 @@ int Stat1401(DEVICE_EXTENSION * pdx)
{
int iReturn;
mutex_lock(&pdx->io_mutex); // Protect disconnect from new i/o
- Allowi(pdx, false); // make sure we allow pending chars
+ Allowi(pdx); // make sure we allow pending chars
SendChars(pdx); // in both directions
iReturn = pdx->dwNumInput; // no lock as single read
mutex_unlock(&pdx->io_mutex); // Protect disconnect from new i/o
@@ -550,7 +550,7 @@ int LineCount(DEVICE_EXTENSION * pdx)
int iReturn = 0; // will be count of line ends
mutex_lock(&pdx->io_mutex); // Protect disconnect from new i/o
- Allowi(pdx, false); // Make sure char reads are running
+ Allowi(pdx); // Make sure char reads are running
SendChars(pdx); // and send any buffered chars
spin_lock_irq(&pdx->charInLock); // Get protection