Staging: gdm724x: gdm_usb: added error checking in do_tx()
authorAbel Moyo <abelmoyo.ab@gmail.com>
Thu, 18 Sep 2014 19:49:10 +0000 (21:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2014 23:56:46 +0000 (16:56 -0700)
Added error checking for alloc_tx_struct in do_tx()

Signed-off-by: Abel Moyo <abelmoyo.ab@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm724x/gdm_usb.c

index 483185bb4ecfa2651dc6a9d9a54a61d74664ca19..5d44490ba77c94425e551ab35dcde015ade2acac 100644 (file)
@@ -682,6 +682,10 @@ static void do_tx(struct work_struct *work)
                }
 
                t = alloc_tx_struct(TX_BUF_SIZE);
+               if (t == NULL) {
+                       spin_unlock_irqrestore(&tx->lock, flags);
+                       return;
+               }
                t->callback = NULL;
                t->tx = tx;
                t->is_sdu = 1;