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
nexedi
linux
Commits
0a36f1fd
Commit
0a36f1fd
authored
Jul 17, 2003
by
Henning Meier-Geinitz
Committed by
Greg Kroah-Hartman
Jul 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: unlink interrupt URBs in scanner driver
Clean up irq urb when not enough memory is available.
parent
cf6c308a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
drivers/usb/image/scanner.c
drivers/usb/image/scanner.c
+7
-0
No files found.
drivers/usb/image/scanner.c
View file @
0a36f1fd
...
@@ -367,6 +367,7 @@
...
@@ -367,6 +367,7 @@
* 0.4.14 2003-07-15
* 0.4.14 2003-07-15
* - Fixed race between open and probe (Oliver Neukum).
* - Fixed race between open and probe (Oliver Neukum).
* - Added vendor/product ids for Avision, Canon, HP, Microtek and Relisys scanners.
* - Added vendor/product ids for Avision, Canon, HP, Microtek and Relisys scanners.
* - Clean up irq urb when not enough memory is available.
*
*
* TODO
* TODO
* - Performance
* - Performance
...
@@ -1072,6 +1073,9 @@ probe_scanner(struct usb_interface *intf,
...
@@ -1072,6 +1073,9 @@ probe_scanner(struct usb_interface *intf,
/* Ok, now initialize all the relevant values */
/* Ok, now initialize all the relevant values */
if
(
!
(
scn
->
obuf
=
(
char
*
)
kmalloc
(
OBUF_SIZE
,
GFP_KERNEL
)))
{
if
(
!
(
scn
->
obuf
=
(
char
*
)
kmalloc
(
OBUF_SIZE
,
GFP_KERNEL
)))
{
err
(
"probe_scanner(%d): Not enough memory for the output buffer."
,
intf
->
minor
);
err
(
"probe_scanner(%d): Not enough memory for the output buffer."
,
intf
->
minor
);
if
(
have_intr
)
usb_unlink_urb
(
scn
->
scn_irq
);
usb_free_urb
(
scn
->
scn_irq
);
kfree
(
scn
);
kfree
(
scn
);
up
(
&
scn_mutex
);
up
(
&
scn_mutex
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -1080,6 +1084,9 @@ probe_scanner(struct usb_interface *intf,
...
@@ -1080,6 +1084,9 @@ probe_scanner(struct usb_interface *intf,
if
(
!
(
scn
->
ibuf
=
(
char
*
)
kmalloc
(
IBUF_SIZE
,
GFP_KERNEL
)))
{
if
(
!
(
scn
->
ibuf
=
(
char
*
)
kmalloc
(
IBUF_SIZE
,
GFP_KERNEL
)))
{
err
(
"probe_scanner(%d): Not enough memory for the input buffer."
,
intf
->
minor
);
err
(
"probe_scanner(%d): Not enough memory for the input buffer."
,
intf
->
minor
);
if
(
have_intr
)
usb_unlink_urb
(
scn
->
scn_irq
);
usb_free_urb
(
scn
->
scn_irq
);
kfree
(
scn
->
obuf
);
kfree
(
scn
->
obuf
);
kfree
(
scn
);
kfree
(
scn
);
up
(
&
scn_mutex
);
up
(
&
scn_mutex
);
...
...
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