diff options
Diffstat (limited to 'drivers/staging/ozwpan/ozhcd.c')
-rw-r--r-- | drivers/staging/ozwpan/ozhcd.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index 8543bb2..5ff4716 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c @@ -280,17 +280,20 @@ static void oz_free_urb_link(struct oz_urb_link *urbl) */ static struct oz_endpoint *oz_ep_alloc(int buffer_size, gfp_t mem_flags) { - struct oz_endpoint *ep = - kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags); - if (ep) { - INIT_LIST_HEAD(&ep->urb_list); - INIT_LIST_HEAD(&ep->link); - ep->credit = -1; - if (buffer_size) { - ep->buffer_size = buffer_size; - ep->buffer = (u8 *)(ep+1); - } + struct oz_endpoint *ep; + + ep = kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags); + if (!ep) + return NULL; + + INIT_LIST_HEAD(&ep->urb_list); + INIT_LIST_HEAD(&ep->link); + ep->credit = -1; + if (buffer_size) { + ep->buffer_size = buffer_size; + ep->buffer = (u8 *)(ep+1); } + return ep; } |