X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fmessage%2Ffusion%2Fmptctl.c;fp=drivers%2Fmessage%2Ffusion%2Fmptctl.c;h=02b5f69e1a423f2dd44eede58aaf010d55f3c9d9;hb=febdfbd2137a5727f70dfbf920105c07e6c2a21e;hp=fc73937290812df292d9654ed43ec19f40497edf;hpb=0da39687a15403251bdfd1c6fb18025c0607326b;p=cascardo%2Flinux.git diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index fc7393729081..02b5f69e1a42 100644 --- 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;