提交 72129cd6 编写于 作者: A Alexey Dobriyan 提交者: Greg Kroah-Hartman

[PATCH] mdc800: remove embrions of C++ exceptions

Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 3f13e66e
...@@ -975,13 +975,13 @@ static struct usb_driver mdc800_usb_driver = ...@@ -975,13 +975,13 @@ static struct usb_driver mdc800_usb_driver =
Init and Cleanup this driver (Main Functions) Init and Cleanup this driver (Main Functions)
*************************************************************************/ *************************************************************************/
#define try(A) if (!(A)) goto cleanup_on_fail;
static int __init usb_mdc800_init (void) static int __init usb_mdc800_init (void)
{ {
int retval = -ENODEV; int retval = -ENODEV;
/* Allocate Memory */ /* 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)); memset(mdc800, 0, sizeof(struct mdc800_data));
mdc800->dev = NULL; mdc800->dev = NULL;
...@@ -997,13 +997,25 @@ static int __init usb_mdc800_init (void) ...@@ -997,13 +997,25 @@ static int __init usb_mdc800_init (void)
mdc800->downloaded = 0; mdc800->downloaded = 0;
mdc800->written = 0; mdc800->written = 0;
try (mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL)); mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL);
try (mdc800->write_urb_buffer=kmalloc (8, GFP_KERNEL)); if (!mdc800->irq_urb_buffer)
try (mdc800->download_urb_buffer=kmalloc (64, GFP_KERNEL)); 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)); mdc800->irq_urb=usb_alloc_urb (0, GFP_KERNEL);
try (mdc800->download_urb=usb_alloc_urb (0, GFP_KERNEL)); if (!mdc800->irq_urb)
try (mdc800->write_urb=usb_alloc_urb (0, GFP_KERNEL)); 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 */ /* Register the driver */
retval = usb_register(&mdc800_usb_driver); retval = usb_register(&mdc800_usb_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册