diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-02-18 15:18:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 11:16:56 -0800 |
commit | 75bc5fad154590e8dda5772669cf9b6f44bb873b (patch) | |
tree | 213e3b50c698f1c569468f729e326856e6caddd0 /drivers/staging/gdm724x | |
parent | a469fe1ab88e19cad0995504973c5400cf24bb17 (diff) | |
download | linux-75bc5fad154590e8dda5772669cf9b6f44bb873b.tar.gz linux-75bc5fad154590e8dda5772669cf9b6f44bb873b.tar.bz2 linux-75bc5fad154590e8dda5772669cf9b6f44bb873b.zip |
staging: gdm724x: cleanup alloc_tx_sdu_struct()
The kfree(t_sdu->buf) sets off a private static checker warning because
"t_sdu->buf" is always NULL.
This function just allocates two pointers so we can re-write it to be
simpler.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm724x')
-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 33458a583142..03b43056fcf2 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; } |