Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10828
b: refs/heads/master
c: 72129cd
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent 6a43a51 commit c3bbfcb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 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: 3f13e66e219238e025ff561d69826da9342c3f4a
refs/heads/master: 72129cd6577793408ff546b0ddd5794c33f32399
30 changes: 21 additions & 9 deletions trunk/drivers/usb/image/mdc800.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,13 +975,13 @@ static struct usb_driver mdc800_usb_driver =
Init and Cleanup this driver (Main Functions)
*************************************************************************/

#define try(A) if (!(A)) goto cleanup_on_fail;

static int __init usb_mdc800_init (void)
{
int retval = -ENODEV;
/* Allocate Memory */
try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL));
mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL);
if (!mdc800)
goto cleanup_on_fail;

memset(mdc800, 0, sizeof(struct mdc800_data));
mdc800->dev = NULL;
Expand All @@ -997,13 +997,25 @@ static int __init usb_mdc800_init (void)
mdc800->downloaded = 0;
mdc800->written = 0;

try (mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL));
try (mdc800->write_urb_buffer=kmalloc (8, GFP_KERNEL));
try (mdc800->download_urb_buffer=kmalloc (64, GFP_KERNEL));
mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL);
if (!mdc800->irq_urb_buffer)
goto cleanup_on_fail;
mdc800->write_urb_buffer=kmalloc (8, GFP_KERNEL);
if (!mdc800->write_urb_buffer)
goto cleanup_on_fail;
mdc800->download_urb_buffer=kmalloc (64, GFP_KERNEL);
if (!mdc800->download_urb_buffer)
goto cleanup_on_fail;

try (mdc800->irq_urb=usb_alloc_urb (0, GFP_KERNEL));
try (mdc800->download_urb=usb_alloc_urb (0, GFP_KERNEL));
try (mdc800->write_urb=usb_alloc_urb (0, GFP_KERNEL));
mdc800->irq_urb=usb_alloc_urb (0, GFP_KERNEL);
if (!mdc800->irq_urb)
goto cleanup_on_fail;
mdc800->download_urb=usb_alloc_urb (0, GFP_KERNEL);
if (!mdc800->download_urb)
goto cleanup_on_fail;
mdc800->write_urb=usb_alloc_urb (0, GFP_KERNEL);
if (!mdc800->write_urb)
goto cleanup_on_fail;

/* Register the driver */
retval = usb_register(&mdc800_usb_driver);
Expand Down

0 comments on commit c3bbfcb

Please sign in to comment.