diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/gdm724x/gdm_usb.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index 33458a5..03b4305 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -119,28 +119,15 @@ out: static struct usb_tx_sdu *alloc_tx_sdu_struct(void) { - struct usb_tx_sdu *t_sdu = NULL; - int ret = 0; - + struct usb_tx_sdu *t_sdu; t_sdu = kzalloc(sizeof(struct usb_tx_sdu), GFP_ATOMIC); - if (!t_sdu) { - ret = -ENOMEM; - goto out; - } + if (!t_sdu) + return NULL; t_sdu->buf = kmalloc(SDU_BUF_SIZE, GFP_ATOMIC); if (!t_sdu->buf) { - ret = -ENOMEM; - goto out; - } -out: - - if (ret < 0) { - if (t_sdu) { - kfree(t_sdu->buf); - kfree(t_sdu); - } + kfree(t_sdu); return NULL; } |