diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index a1ab2ef45578..bca5955339b8 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1953,8 +1953,6 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1953 | errCode = em28xx_config(dev); | 1953 | errCode = em28xx_config(dev); |
1954 | if (errCode) { | 1954 | if (errCode) { |
1955 | em28xx_errdev("error configuring device\n"); | 1955 | em28xx_errdev("error configuring device\n"); |
1956 | em28xx_devused &= ~(1<<dev->devno); | ||
1957 | kfree(dev); | ||
1958 | return -ENOMEM; | 1956 | return -ENOMEM; |
1959 | } | 1957 | } |
1960 | 1958 | ||
@@ -2088,7 +2086,6 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
2088 | fail_unreg: | 2086 | fail_unreg: |
2089 | em28xx_release_resources(dev); | 2087 | em28xx_release_resources(dev); |
2090 | mutex_unlock(&dev->lock); | 2088 | mutex_unlock(&dev->lock); |
2091 | kfree(dev); | ||
2092 | return retval; | 2089 | return retval; |
2093 | } | 2090 | } |
2094 | 2091 | ||
@@ -2231,8 +2228,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
2231 | 2228 | ||
2232 | /* allocate device struct */ | 2229 | /* allocate device struct */ |
2233 | retval = em28xx_init_dev(&dev, udev, nr); | 2230 | retval = em28xx_init_dev(&dev, udev, nr); |
2234 | if (retval) | 2231 | if (retval) { |
2232 | em28xx_devused &= ~(1<<dev->devno); | ||
2233 | kfree(dev); | ||
2234 | |||
2235 | return retval; | 2235 | return retval; |
2236 | } | ||
2236 | 2237 | ||
2237 | em28xx_info("Found %s\n", em28xx_boards[dev->model].name); | 2238 | em28xx_info("Found %s\n", em28xx_boards[dev->model].name); |
2238 | 2239 | ||