Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325259
b: refs/heads/master
c: 129575f
h: refs/heads/master
i:
  325257: b5f85e4
  325255: f89c84c
v: v3
  • Loading branch information
Ben Chan authored and Greg Kroah-Hartman committed Sep 14, 2012
1 parent 15027c8 commit 3d71359
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b37c1aeed89062a82da9bf78c83db0328d08e95d
refs/heads/master: 129575f2a8958a1e90780b0d5b80702bb45b5aac
30 changes: 10 additions & 20 deletions trunk/drivers/staging/gdm72xx/gdm_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,20 @@ static void hexdump(char *title, u8 *data, int len)

static struct sdio_tx *alloc_tx_struct(struct tx_cxt *tx)
{
struct sdio_tx *t = NULL;
struct sdio_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);

t = kzalloc(sizeof(*t), GFP_ATOMIC);
if (t == NULL)
goto out;
if (!t)
return NULL;

t->buf = kmalloc(TX_BUF_SIZE, GFP_ATOMIC);
if (t->buf == NULL)
goto out;
if (!t->buf) {
kfree(t);
return NULL;
}

t->tx_cxt = tx;

return t;
out:
if (t) {
kfree(t->buf);
kfree(t);
}
return NULL;
}

static void free_tx_struct(struct sdio_tx *t)
Expand All @@ -91,15 +86,10 @@ static void free_tx_struct(struct sdio_tx *t)

static struct sdio_rx *alloc_rx_struct(struct rx_cxt *rx)
{
struct sdio_rx *r = NULL;

r = kmalloc(sizeof(*r), GFP_ATOMIC);
if (!r)
return NULL;

memset(r, 0, sizeof(*r));
struct sdio_rx *r = kzalloc(sizeof(*r), GFP_ATOMIC);

r->rx_cxt = rx;
if (r)
r->rx_cxt = rx;

return r;
}
Expand Down
44 changes: 17 additions & 27 deletions trunk/drivers/staging/gdm72xx/gdm_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,23 @@ static void hexdump(char *title, u8 *data, int len)

static struct usb_tx *alloc_tx_struct(struct tx_cxt *tx)
{
struct usb_tx *t = NULL;
struct usb_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);

t = kzalloc(sizeof(*t), GFP_ATOMIC);
if (t == NULL)
goto out;
if (!t)
return NULL;

t->urb = usb_alloc_urb(0, GFP_ATOMIC);
t->buf = kmalloc(TX_BUF_SIZE, GFP_ATOMIC);
if (t->urb == NULL || t->buf == NULL)
goto out;

t->tx_cxt = tx;

return t;
out:
if (t) {
if (!t->urb || !t->buf) {
usb_free_urb(t->urb);
kfree(t->buf);
kfree(t);
return NULL;
}
return NULL;

t->tx_cxt = tx;

return t;
}

static void free_tx_struct(struct usb_tx *t)
Expand All @@ -107,28 +103,22 @@ static void free_tx_struct(struct usb_tx *t)

static struct usb_rx *alloc_rx_struct(struct rx_cxt *rx)
{
struct usb_rx *r = NULL;
struct usb_rx *r = kzalloc(sizeof(*r), GFP_ATOMIC);

r = kmalloc(sizeof(*r), GFP_ATOMIC);
if (r == NULL)
goto out;

memset(r, 0, sizeof(*r));
if (!r)
return NULL;

r->urb = usb_alloc_urb(0, GFP_ATOMIC);
r->buf = kmalloc(RX_BUF_SIZE, GFP_ATOMIC);
if (r->urb == NULL || r->buf == NULL)
goto out;

r->rx_cxt = rx;
return r;
out:
if (r) {
if (!r->urb || !r->buf) {
usb_free_urb(r->urb);
kfree(r->buf);
kfree(r);
return NULL;
}
return NULL;

r->rx_cxt = rx;
return r;
}

static void free_rx_struct(struct usb_rx *r)
Expand Down

0 comments on commit 3d71359

Please sign in to comment.