projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
mptfusion: don't allow negative bytes in kbuf_alloc_2_sgl()
[cascardo/linux.git]
/
drivers
/
message
/
fusion
/
mptctl.c
diff --git
a/drivers/message/fusion/mptctl.c
b/drivers/message/fusion/mptctl.c
index
fc73937
..
02b5f69
100644
(file)
--- a/
drivers/message/fusion/mptctl.c
+++ b/
drivers/message/fusion/mptctl.c
@@
-1038,6
+1038,10
@@
kbuf_alloc_2_sgl(int bytes, u32 sgdir, int sge_offset, int *frags,
int i, buflist_ent;
int sg_spill = MAX_FRAGS_SPILL1;
int dir;
+
+ if (bytes < 0)
+ return NULL;
+
/* initialization */
*frags = 0;
*blp = NULL;