From 29d0c07428d590ad93fd4721ff0e2f8f5ca8f264 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 24 Jul 2013 14:08:43 -0700 Subject: [PATCH] staging: comedi: usbdux: remove unnecessary tidy_up() calls If the comedi_driver (*auto_attach) fails, the comedi core will call the (*detach) function to do any cleanup. It's not necessary to do the cleanup in the (*auto_attach). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/usbdux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 8102efbced79..6a7d7f4aabec 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -2294,17 +2294,14 @@ static int usbdux_auto_attach(struct comedi_device *dev, } ret = usbdux_alloc_usb_buffers(devpriv); - if (ret) { - tidy_up(devpriv); + if (ret) return ret; - } /* setting to alternate setting 3: enabling iso ep and bulk ep. */ ret = usb_set_interface(devpriv->usbdev, devpriv->ifnum, 3); if (ret < 0) { dev_err(dev->class_dev, "could not set alternate setting 3 in high speed\n"); - tidy_up(devpriv); return ret; } -- 2.39.5