diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-01-11 13:01:39 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-11 16:44:10 -0800 |
commit | 955e7da82d8cc917a2c604c782b525dec3466921 (patch) | |
tree | e213d81f73c31d7883b9058b93ddf1572dd79a22 /drivers/staging/ced1401/usb1401.c | |
parent | ccbdccd4a7981c150a882123a577c11b2e808051 (diff) | |
download | kernel_goldelico_gta04-955e7da82d8cc917a2c604c782b525dec3466921.zip kernel_goldelico_gta04-955e7da82d8cc917a2c604c782b525dec3466921.tar.gz kernel_goldelico_gta04-955e7da82d8cc917a2c604c782b525dec3466921.tar.bz2 |
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/usb1401.c')
-rw-r--r-- | drivers/staging/ced1401/usb1401.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/ced1401/usb1401.c b/drivers/staging/ced1401/usb1401.c index a27043a..60bed3e 100644 --- a/drivers/staging/ced1401/usb1401.c +++ b/drivers/staging/ced1401/usb1401.c @@ -697,7 +697,7 @@ static void staged_callback(struct urb *pUrb) // in Allowi as if it were protected by the char lock. In any case, most systems will // not be upset by char input during DMA... sigh. Needs sorting out. if (bRestartCharInput) // may be out of date, but... - Allowi(pdx, true); // ...Allowi tests a lock too. + Allowi(pdx); // ...Allowi tests a lock too. dev_dbg(&pdx->interface->dev, "%s done", __func__); } @@ -1172,7 +1172,7 @@ static void ced_readchar_callback(struct urb *pUrb) pdx->bReadCharsPending = false; // No longer have a pending read spin_unlock(&pdx->charInLock); // already at irq level - Allowi(pdx, true); // see if we can do the next one + Allowi(pdx); // see if we can do the next one } /**************************************************************************** @@ -1182,7 +1182,7 @@ static void ced_readchar_callback(struct urb *pUrb) ** we can pick up any inward transfers. This can be called in multiple contexts ** so we use the irqsave version of the spinlock. ****************************************************************************/ -int Allowi(DEVICE_EXTENSION * pdx, bool bInCallback) +int Allowi(DEVICE_EXTENSION * pdx) { int iReturn = U14ERR_NOERROR; unsigned long flags; @@ -1211,9 +1211,7 @@ int Allowi(DEVICE_EXTENSION * pdx, bool bInCallback) pdx, pdx->bInterval); pdx->pUrbCharIn->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; // short xfers are OK by default usb_anchor_urb(pdx->pUrbCharIn, &pdx->submitted); // in case we need to kill it - iReturn = - usb_submit_urb(pdx->pUrbCharIn, - bInCallback ? GFP_ATOMIC : GFP_KERNEL); + iReturn = usb_submit_urb(pdx->pUrbCharIn, GFP_ATOMIC); if (iReturn) { usb_unanchor_urb(pdx->pUrbCharIn); // remove from list of active Urbs pdx->bPipeError[nPipe] = 1; // Flag an error to be handled later |