Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
47d72de3
Commit
47d72de3
authored
Aug 09, 2002
by
Oliver Neukum
Committed by
Greg Kroah-Hartman
Aug 09, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix urb leak in error in cdc-ether
Probably leftover of statically allocated urbs. fix memory leak
parent
b2fb8f66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
drivers/usb/net/cdc-ether.c
drivers/usb/net/cdc-ether.c
+25
-23
No files found.
drivers/usb/net/cdc-ether.c
View file @
47d72de3
...
...
@@ -1170,23 +1170,20 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
if
(
rc
)
{
// Nope we couldn't find one we liked.
// This device was not meant for us to control.
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
// Now that we FOUND a configuration. let's try to make the
// device go into it.
if
(
usb_set_configuration
(
usb
,
ether_dev
->
bConfigurationValue
)
)
{
err
(
"usb_set_configuration() failed"
);
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
// Now set the communication interface up as required.
if
(
usb_set_interface
(
usb
,
ether_dev
->
comm_bInterfaceNumber
,
ether_dev
->
comm_bAlternateSetting
))
{
err
(
"usb_set_interface() failed"
);
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
// Only turn traffic on right now if we must...
...
...
@@ -1198,8 +1195,7 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
ether_dev
->
data_bInterfaceNumber
,
ether_dev
->
data_bAlternateSetting_without_traffic
))
{
err
(
"usb_set_interface() failed"
);
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
}
else
{
// We didn't find an alternate setting for the data
...
...
@@ -1209,8 +1205,7 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
ether_dev
->
data_bInterfaceNumber
,
ether_dev
->
data_bAlternateSetting_with_traffic
))
{
err
(
"usb_set_interface() failed"
);
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
}
...
...
@@ -1220,8 +1215,7 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
// Hmm... The kernel is not sharing today...
// Fine, we didn't want it anyway...
err
(
"Unable to initialize ethernet device"
);
kfree
(
ether_dev
);
return
NULL
;
goto
error_all
;
}
// Now that we have an ethernet device, let's set it up
...
...
@@ -1265,6 +1259,14 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
// Okay, we are finally done...
return
NULL
;
// bailing out with our tail between our knees
error_all:
usb_free_urb
(
ether_dev
->
tx_urb
);
usb_free_urb
(
ether_dev
->
rx_urb
);
usb_free_urb
(
ether_dev
->
intr_urb
);
kfree
(
ether_dev
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment