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
8396ce28
Commit
8396ce28
authored
Mar 07, 2003
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DMA to stack problem in scsi_error.c
parent
66e3869c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
drivers/scsi/scsi_error.c
drivers/scsi/scsi_error.c
+14
-15
No files found.
drivers/scsi/scsi_error.c
View file @
8396ce28
...
@@ -544,20 +544,20 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
...
@@ -544,20 +544,20 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
static
int
scsi_request_sense
(
struct
scsi_cmnd
*
scmd
)
static
int
scsi_request_sense
(
struct
scsi_cmnd
*
scmd
)
{
{
static
unsigned
char
generic_sense
[
6
]
=
static
unsigned
char
generic_sense
[
6
]
=
{
REQUEST_SENSE
,
0
,
0
,
0
,
25
5
,
0
};
{
REQUEST_SENSE
,
0
,
0
,
0
,
25
4
,
0
};
unsigned
char
scsi_result0
[
256
],
*
scsi_result
=
&
scsi_result0
[
0
]
;
unsigned
char
*
scsi_result
;
int
saved_result
;
int
saved_result
;
int
rtn
;
int
rtn
;
memcpy
(
scmd
->
cmnd
,
generic_sense
,
sizeof
(
generic_sense
));
memcpy
(
scmd
->
cmnd
,
generic_sense
,
sizeof
(
generic_sense
));
if
(
scmd
->
device
->
host
->
hostt
->
unchecked_isa_dma
)
{
scsi_result
=
kmalloc
(
254
,
GFP_ATOMIC
|
(
scmd
->
device
->
host
->
hostt
->
unchecked_isa_dma
)
?
__GFP_DMA
:
0
);
scsi_result
=
kmalloc
(
512
,
GFP_ATOMIC
|
__GFP_DMA
);
if
(
unlikely
(
!
scsi_result
))
{
printk
(
KERN_ERR
"%s: cannot allocate scsi_result.
\n
"
,
if
(
unlikely
(
!
scsi_result
))
{
__FUNCTION__
);
printk
(
KERN_ERR
"%s: cannot allocate scsi_result.
\n
"
,
return
FAILED
;
__FUNCTION__
)
;
}
return
FAILED
;
}
}
/*
/*
...
@@ -567,11 +567,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
...
@@ -567,11 +567,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
* address (db). 0 is not a valid sense code.
* address (db). 0 is not a valid sense code.
*/
*/
memset
(
scmd
->
sense_buffer
,
0
,
sizeof
(
scmd
->
sense_buffer
));
memset
(
scmd
->
sense_buffer
,
0
,
sizeof
(
scmd
->
sense_buffer
));
memset
(
scsi_result
,
0
,
25
6
);
memset
(
scsi_result
,
0
,
25
4
);
saved_result
=
scmd
->
result
;
saved_result
=
scmd
->
result
;
scmd
->
request_buffer
=
scsi_result
;
scmd
->
request_buffer
=
scsi_result
;
scmd
->
request_bufflen
=
25
6
;
scmd
->
request_bufflen
=
25
4
;
scmd
->
use_sg
=
0
;
scmd
->
use_sg
=
0
;
scmd
->
cmd_len
=
COMMAND_SIZE
(
scmd
->
cmnd
[
0
]);
scmd
->
cmd_len
=
COMMAND_SIZE
(
scmd
->
cmnd
[
0
]);
scmd
->
sc_data_direction
=
SCSI_DATA_READ
;
scmd
->
sc_data_direction
=
SCSI_DATA_READ
;
...
@@ -580,13 +580,12 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
...
@@ -580,13 +580,12 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
rtn
=
scsi_send_eh_cmnd
(
scmd
,
SENSE_TIMEOUT
);
rtn
=
scsi_send_eh_cmnd
(
scmd
,
SENSE_TIMEOUT
);
/* last chance to have valid sense data */
/* last chance to have valid sense data */
if
(
!
SCSI_SENSE_VALID
(
scmd
))
{
if
(
!
SCSI_SENSE_VALID
(
scmd
))
{
memcpy
(
scmd
->
sense_buffer
,
scmd
->
request_buffer
,
memcpy
(
scmd
->
sense_buffer
,
scmd
->
request_buffer
,
sizeof
(
scmd
->
sense_buffer
));
sizeof
(
scmd
->
sense_buffer
));
}
}
if
(
scsi_result
!=
&
scsi_result0
[
0
])
kfree
(
scsi_result
);
kfree
(
scsi_result
);
/*
/*
* when we eventually call scsi_finish, we really wish to complete
* when we eventually call scsi_finish, we really wish to complete
...
...
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